Record Class TeleportRandomlyConsumeEffect
java.lang.Object
java.lang.Record
net.minecraft.world.item.consume_effects.TeleportRandomlyConsumeEffect
- All Implemented Interfaces:
ConsumeEffect
-
Nested Class Summary
Nested classes/interfaces inherited from interface ConsumeEffect
ConsumeEffect.Type<T> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<TeleportRandomlyConsumeEffect> private static final floatprivate final floatThe field for thediameterrecord component.static final StreamCodec<RegistryFriendlyByteBuf, TeleportRandomlyConsumeEffect> -
Constructor Summary
ConstructorsConstructorDescriptionTeleportRandomlyConsumeEffect(float diameter) Creates an instance of aTeleportRandomlyConsumeEffectrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanapply(Level level, ItemStack stack, LivingEntity user) floatdiameter()Returns the value of thediameterrecord component.final booleanIndicates whether some other object is "equal to" this one.getType()final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
diameter
private final float diameterThe field for thediameterrecord component. -
DEFAULT_DIAMETER
private static final float DEFAULT_DIAMETER- See Also:
-
CODEC
-
STREAM_CODEC
public static final StreamCodec<RegistryFriendlyByteBuf, TeleportRandomlyConsumeEffect> STREAM_CODEC
-
-
Constructor Details
-
TeleportRandomlyConsumeEffect
public TeleportRandomlyConsumeEffect() -
TeleportRandomlyConsumeEffect
public TeleportRandomlyConsumeEffect(float diameter) Creates an instance of aTeleportRandomlyConsumeEffectrecord class.- Parameters:
diameter- the value for thediameterrecord component
-
-
Method Details
-
getType
- Specified by:
getTypein interfaceConsumeEffect
-
apply
- Specified by:
applyin interfaceConsumeEffect
-
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. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
diameter
public float diameter()Returns the value of thediameterrecord component.- Returns:
- the value of the
diameterrecord component
-