Record Class SetBlockProperties
java.lang.Object
java.lang.Record
net.minecraft.world.item.enchantment.effects.SetBlockProperties
- All Implemented Interfaces:
EnchantmentEntityEffect,EnchantmentLocationBasedEffect
public record SetBlockProperties(BlockItemStateProperties properties, Vec3i offset, Optional<Holder<GameEvent>> triggerGameEvent)
extends Record
implements EnchantmentEntityEffect
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<SetBlockProperties> private final Vec3iThe field for theoffsetrecord component.private final BlockItemStatePropertiesThe field for thepropertiesrecord component.The field for thetriggerGameEventrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionSetBlockProperties(BlockItemStateProperties p_344788_) SetBlockProperties(BlockItemStateProperties properties, Vec3i offset, Optional<Holder<GameEvent>> triggerGameEvent) Creates an instance of aSetBlockPropertiesrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(ServerLevel p_342336_, int p_343053_, EnchantedItemInUse p_345372_, Entity p_342035_, Vec3 p_344224_) com.mojang.serialization.MapCodec<SetBlockProperties> codec()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.offset()Returns the value of theoffsetrecord component.Returns the value of thepropertiesrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thetriggerGameEventrecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.world.item.enchantment.effects.EnchantmentEntityEffect
onChangedBlockMethods inherited from interface net.minecraft.world.item.enchantment.effects.EnchantmentLocationBasedEffect
onDeactivated
-
Field Details
-
properties
The field for thepropertiesrecord component. -
offset
The field for theoffsetrecord component. -
triggerGameEvent
The field for thetriggerGameEventrecord component. -
CODEC
-
-
Constructor Details
-
SetBlockProperties
-
SetBlockProperties
public SetBlockProperties(BlockItemStateProperties properties, Vec3i offset, Optional<Holder<GameEvent>> triggerGameEvent) Creates an instance of aSetBlockPropertiesrecord class.- Parameters:
properties- the value for thepropertiesrecord componentoffset- the value for theoffsetrecord componenttriggerGameEvent- the value for thetriggerGameEventrecord component
-
-
Method Details
-
apply
public void apply(ServerLevel p_342336_, int p_343053_, EnchantedItemInUse p_345372_, Entity p_342035_, Vec3 p_344224_) - Specified by:
applyin interfaceEnchantmentEntityEffect
-
codec
- Specified by:
codecin interfaceEnchantmentEntityEffect- Specified by:
codecin interfaceEnchantmentLocationBasedEffect
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 withObjects::equals(Object,Object). -
properties
Returns the value of thepropertiesrecord component.- Returns:
- the value of the
propertiesrecord component
-
offset
Returns the value of theoffsetrecord component.- Returns:
- the value of the
offsetrecord component
-
triggerGameEvent
Returns the value of thetriggerGameEventrecord component.- Returns:
- the value of the
triggerGameEventrecord component
-