Annotation Interface Param


The parameter codec field type will try to store and load a parameter based on a different codec. For that it needs to find a matching codec to use. It will search for them in this order by default:
  • Look for a default codec provided by DataFixerUpper
  • Try to find a matching public static field in the class of the parameter type with the name CODEC or DIRECT_CODEC.
You can customise the class and field name to look after a codec using this annotation. By this you can create default values easily by creating a class with a field named CODEC that holds a codec for a value and adds a default to it.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Field name of the codec field.
    Class where to find the codec field.
  • Element Details

    • value

      Class<?> value
      Class where to find the codec field. Can be left empty to use the class of the parameter type.
      Default:
      void.class
    • field

      String field
      Field name of the codec field. Can be left empty to use the default value ModInit looks for.
      Default:
      ""