Record Class GameEvent
java.lang.Object
java.lang.Record
net.minecraft.world.level.gameevent.GameEvent
- Record Components:
notificationRadius
- The radius around an event source to broadcast this event. Any listeners within this radius will be notified when the event happens.
Describes an in game event or action that can be detected by listeners such as the Sculk Sensor block.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
static final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Holder.Reference
<GameEvent> static final Holder.Reference
<GameEvent> This event is broadcast when a block is attached to another.static final Holder.Reference
<GameEvent> This event is broadcast when a block is changed.static final Holder.Reference
<GameEvent> This event is broadcast when a block such as a door, trap door, or gate is closed.static final Holder.Reference
<GameEvent> static final Holder.Reference
<GameEvent> This event is broadcast when a block is destroyed or picked up by an enderman.static final Holder.Reference
<GameEvent> This event is broadcast when a block is detached from another block.static final Holder.Reference
<GameEvent> This event is broadcast when a block such as a door, trap door, or gate has been opened.static final Holder.Reference
<GameEvent> This event is broadcast when a block is placed in the world.static final Holder.Reference
<GameEvent> This event is broadcast when a block with a storage inventory such as a chest or barrel is closed.static final Holder.Reference
<GameEvent> This event is broadcast when a block with a storage inventory such as a chest or barrel is opened.static final int
The default notification radius for events to be broadcasted.static final Holder.Reference
<GameEvent> static final Holder.Reference
<GameEvent> This event is broadcast when an entity consumes food.static final Holder.Reference
<GameEvent> static final Holder.Reference
<GameEvent> static final Holder.Reference
<GameEvent> static final Holder.Reference
<GameEvent> static final Holder.Reference
<GameEvent> static final Holder.Reference
<GameEvent> static final Holder.Reference
<GameEvent> static final Holder.Reference
<GameEvent> This event is broadcast when an entity is artificially placed in the world using an item.static final Holder.Reference
<GameEvent> This event is broadcast when an item is equipped to an entity or armor stand.static final Holder.Reference
<GameEvent> This event is broadcast when an entity such as a creeper, tnt, or a firework explodes.static final Holder.Reference
<GameEvent> This event is broadcast when a flying entity such as the ender dragon flaps its wings.static final Holder.Reference
<GameEvent> This event is broadcast when a fluid is picked up.static final Holder.Reference
<GameEvent> This event is broadcast when fluid is placed.static final Holder.Reference
<GameEvent> This event is broadcast when an entity falls far enough to take fall damage.static final Holder.Reference
<GameEvent> static final Holder.Reference
<GameEvent> static final Holder.Reference
<GameEvent> static final Holder.Reference
<GameEvent> static final Holder.Reference
<GameEvent> static final Holder.Reference
<GameEvent> This event is broadcast when lightning strikes a block.static final Holder.Reference
<GameEvent> private final int
The field for thenotificationRadius
record component.static final Holder.Reference
<GameEvent> This event is broadcast when an entity such as a creeper or TNT begins exploding.static final Holder.Reference
<GameEvent> This event is broadcast when a projectile hits something.static final Holder.Reference
<GameEvent> This event is broadcast when a projectile is fired.static final Holder.Reference
<GameEvent> static final Holder.Reference
<GameEvent> static final Holder.Reference
<GameEvent> static final Holder.Reference
<GameEvent> static final Holder.Reference
<GameEvent> static final Holder.Reference
<GameEvent> static final Holder.Reference
<GameEvent> static final Holder.Reference
<GameEvent> static final Holder.Reference
<GameEvent> static final Holder.Reference
<GameEvent> static final Holder.Reference
<GameEvent> static final Holder.Reference
<GameEvent> static final Holder.Reference
<GameEvent> static final Holder.Reference
<GameEvent> static final Holder.Reference
<GameEvent> static final Holder.Reference
<GameEvent> static final Holder.Reference
<GameEvent> This event is broadcast when a shear is used.static final Holder.Reference
<GameEvent> static final Holder.Reference
<GameEvent> This event is broadcast wen an entity splashes in the water.static final Holder.Reference
<GameEvent> This event is broadcast when an entity moves on the ground.static final Holder.Reference
<GameEvent> This event is broadcast as an entity swims around in water.static final Holder.Reference
<GameEvent> static final Holder.Reference
<GameEvent> -
Constructor Summary
ConstructorsConstructorDescriptionGameEvent
(int notificationRadius) Creates an instance of aGameEvent
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.int
Returns the value of thenotificationRadius
record component.private static Holder.Reference
<GameEvent> private static Holder.Reference
<GameEvent> final String
toString()
Returns a string representation of this record class.
-
Field Details
-
notificationRadius
private final int notificationRadiusThe field for thenotificationRadius
record component. -
BLOCK_ACTIVATE
-
BLOCK_ATTACH
This event is broadcast when a block is attached to another. For example when the tripwire is attached to a tripwire hook. -
BLOCK_CHANGE
This event is broadcast when a block is changed. For example when a flower is removed from a flower pot. -
BLOCK_CLOSE
This event is broadcast when a block such as a door, trap door, or gate is closed. -
BLOCK_DEACTIVATE
-
BLOCK_DESTROY
This event is broadcast when a block is destroyed or picked up by an enderman. -
BLOCK_DETACH
This event is broadcast when a block is detached from another block. For example when the tripwire is removed from the hook. -
BLOCK_OPEN
This event is broadcast when a block such as a door, trap door, or gate has been opened. -
BLOCK_PLACE
This event is broadcast when a block is placed in the world. -
CONTAINER_CLOSE
This event is broadcast when a block with a storage inventory such as a chest or barrel is closed. Some entities like a minecart with chest may also cause this event to be broadcast. -
CONTAINER_OPEN
This event is broadcast when a block with a storage inventory such as a chest or barrel is opened. Some entities like a minecart with chest may also cause this event to be broadcast. -
DRINK
-
EAT
This event is broadcast when an entity consumes food. This includes animals eating grass and other sources of food. -
ELYTRA_GLIDE
-
ENTITY_DAMAGE
-
ENTITY_DIE
-
ENTITY_DISMOUNT
-
ENTITY_INTERACT
-
ENTITY_MOUNT
-
ENTITY_PLACE
This event is broadcast when an entity is artificially placed in the world using an item. For example when a spawn egg is used. -
ENTITY_ACTION
-
EQUIP
This event is broadcast when an item is equipped to an entity or armor stand. -
EXPLODE
This event is broadcast when an entity such as a creeper, tnt, or a firework explodes. -
FLAP
This event is broadcast when a flying entity such as the ender dragon flaps its wings. -
FLUID_PICKUP
This event is broadcast when a fluid is picked up. This includes using a bucket, harvesting honey, filling a bottle, and removing fluid from a cauldron. -
FLUID_PLACE
This event is broadcast when fluid is placed. This includes adding fluid to a cauldron and placing a bucket of fluid. -
HIT_GROUND
This event is broadcast when an entity falls far enough to take fall damage. -
INSTRUMENT_PLAY
-
ITEM_INTERACT_FINISH
-
ITEM_INTERACT_START
-
JUKEBOX_PLAY
-
JUKEBOX_STOP_PLAY
-
LIGHTNING_STRIKE
This event is broadcast when lightning strikes a block. -
NOTE_BLOCK_PLAY
-
PRIME_FUSE
This event is broadcast when an entity such as a creeper or TNT begins exploding. -
PROJECTILE_LAND
This event is broadcast when a projectile hits something. -
PROJECTILE_SHOOT
This event is broadcast when a projectile is fired. -
SCULK_SENSOR_TENDRILS_CLICKING
-
SHEAR
This event is broadcast when a shear is used. This includes disarming tripwires, harvesting honeycombs, carving pumpkins, etc. -
SHRIEK
-
SPLASH
This event is broadcast wen an entity splashes in the water. This includes boats paddling or hitting bubble columns. -
STEP
This event is broadcast when an entity moves on the ground. This includes entities such as minecarts. -
SWIM
This event is broadcast as an entity swims around in water. -
TELEPORT
-
UNEQUIP
-
RESONATE_1
-
RESONATE_2
-
RESONATE_3
-
RESONATE_4
-
RESONATE_5
-
RESONATE_6
-
RESONATE_7
-
RESONATE_8
-
RESONATE_9
-
RESONATE_10
-
RESONATE_11
-
RESONATE_12
-
RESONATE_13
-
RESONATE_14
-
RESONATE_15
-
DEFAULT_NOTIFICATION_RADIUS
public static final int DEFAULT_NOTIFICATION_RADIUSThe default notification radius for events to be broadcasted. @see net.minecraft.world.level.gameevent.GameEvent#register- See Also:
-
CODEC
-
-
Constructor Details
-
GameEvent
public GameEvent(int notificationRadius) Creates an instance of aGameEvent
record class.- Parameters:
notificationRadius
- the value for thenotificationRadius
record component
-
-
Method Details
-
bootstrap
-
register
-
register
-
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 with '=='. -
notificationRadius
public int notificationRadius()Returns the value of thenotificationRadius
record component.- Returns:
- the value of the
notificationRadius
record component
-