Package net.fabricmc.api
Annotation Type Environment
@Retention(CLASS) @Target({TYPE,METHOD,FIELD,CONSTRUCTOR}) @Documented public @interface Environment
Applied to declare that the annotated element is present only in the specified environment.
Use with caution, as Fabric-loader will remove the annotated element in a mismatched environment!
When the annotated element is removed, bytecode associated with the element will not be removed. For example, if a field is removed, its initializer code will not, and will cause an error on execution.
If an overriding method has this annotation and its overridden method doesn't, unexpected behavior may happen. If an overridden method has this annotation while the overriding method doesn't, it is safe, but the method can be used from the overridden class only in the specified environment.
- See Also:
EnvironmentInterface
-
Required Element Summary
-
Element Details
-
value
EnvType valueReturns the environment type that the annotated element is only present in.
-