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
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec
<SetBlockProperties> private final Vec3i
The field for theoffset
record component.private final BlockItemStateProperties
The field for theproperties
record component.The field for thetriggerGameEvent
record component. -
Constructor Summary
ConstructorDescriptionSetBlockProperties
(BlockItemStateProperties p_346404_) SetBlockProperties
(BlockItemStateProperties properties, Vec3i offset, Optional<Holder<GameEvent>> triggerGameEvent) Creates an instance of aSetBlockProperties
record class. -
Method Summary
Modifier and TypeMethodDescriptionvoid
apply
(ServerLevel p_346105_, int p_345373_, EnchantedItemInUse p_346028_, Entity p_346068_, Vec3 p_345511_) com.mojang.serialization.MapCodec
<SetBlockProperties> codec()
final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.offset()
Returns the value of theoffset
record component.Returns the value of theproperties
record component.final String
toString()
Returns a string representation of this record class.Returns the value of thetriggerGameEvent
record component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.world.item.enchantment.effects.EnchantmentEntityEffect
onChangedBlock
Methods inherited from interface net.minecraft.world.item.enchantment.effects.EnchantmentLocationBasedEffect
onDeactivated
-
Field Details
-
properties
The field for theproperties
record component. -
offset
The field for theoffset
record component. -
triggerGameEvent
The field for thetriggerGameEvent
record component. -
CODEC
-
-
Constructor Details
-
SetBlockProperties
-
SetBlockProperties
public SetBlockProperties(BlockItemStateProperties properties, Vec3i offset, Optional<Holder<GameEvent>> triggerGameEvent) Creates an instance of aSetBlockProperties
record class.- Parameters:
properties
- the value for theproperties
record componentoffset
- the value for theoffset
record componenttriggerGameEvent
- the value for thetriggerGameEvent
record component
-
-
Method Details
-
apply
public void apply(ServerLevel p_346105_, int p_345373_, EnchantedItemInUse p_346028_, Entity p_346068_, Vec3 p_345511_) - Specified by:
apply
in interfaceEnchantmentEntityEffect
-
codec
- Specified by:
codec
in interfaceEnchantmentEntityEffect
- Specified by:
codec
in 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 theproperties
record component.- Returns:
- the value of the
properties
record component
-
offset
Returns the value of theoffset
record component.- Returns:
- the value of the
offset
record component
-
triggerGameEvent
Returns the value of thetriggerGameEvent
record component.- Returns:
- the value of the
triggerGameEvent
record component
-