Record Class MobVisibility
java.lang.Object
java.lang.Record
net.minecraft.world.item.component.MobVisibility
public record MobVisibility(HolderSet<EntityType<?>> targetingEntityTypes, float visibility)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<MobVisibility> static final floatstatic final floatstatic final StreamCodec<RegistryFriendlyByteBuf, MobVisibility> private final HolderSet<EntityType<?>> The field for thetargetingEntityTypesrecord component.private final floatThe field for thevisibilityrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionMobVisibility(HolderSet<EntityType<?>> targetingEntityTypes, float visibility) Creates an instance of aMobVisibilityrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.HolderSet<EntityType<?>> Returns the value of thetargetingEntityTypesrecord component.final StringtoString()Returns a string representation of this record class.floatReturns the value of thevisibilityrecord component.
-
Field Details
-
targetingEntityTypes
The field for thetargetingEntityTypesrecord component. -
visibility
private final float visibilityThe field for thevisibilityrecord component. -
MIN_VISIBILITY
public static final float MIN_VISIBILITY- See Also:
-
MAX_VISIBILITY
public static final float MAX_VISIBILITY- See Also:
-
CODEC
-
STREAM_CODEC
-
-
Constructor Details
-
MobVisibility
Creates an instance of aMobVisibilityrecord class.- Parameters:
targetingEntityTypes- the value for thetargetingEntityTypesrecord componentvisibility- the value for thevisibilityrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
targetingEntityTypes
Returns the value of thetargetingEntityTypesrecord component.- Returns:
- the value of the
targetingEntityTypesrecord component
-
visibility
public float visibility()Returns the value of thevisibilityrecord component.- Returns:
- the value of the
visibilityrecord component
-