WorldBeforeEvents Class
A set of events that fire before an actual action occurs. In most cases, you can potentially cancel or modify the impending event. Note that in before events any APIs that modify gameplay state will not function and will throw an error. (e.g., dimension.spawnEntity)
Properties
chatSend
read-only chatSend: ChatSendBeforeEventSignal;
This event is triggered after a chat message has been broadcast or sent to players.
Type: ChatSendBeforeEventSignal
Caution
This property is still in pre-release. Its signature may change or it may be removed in future releases.
effectAdd
read-only effectAdd: EffectAddBeforeEventSignal;
This event is triggered after an event has been added to an entity.
Type: EffectAddBeforeEventSignal
entityRemove
read-only entityRemove: EntityRemoveBeforeEventSignal;
Fires before an entity is removed from the world (for example, unloaded or removed after being killed.)
Type: EntityRemoveBeforeEventSignal
explosion
read-only explosion: ExplosionBeforeEventSignal;
This event is fired after an explosion occurs.
Type: ExplosionBeforeEventSignal
itemUse
read-only itemUse: ItemUseBeforeEventSignal;
This event fires when an item is successfully used by a player.
Type: ItemUseBeforeEventSignal
itemUseOn
read-only itemUseOn: ItemUseOnBeforeEventSignal;
This event fires when an item is used on a block by a player.
Type: ItemUseOnBeforeEventSignal
playerBreakBlock
read-only playerBreakBlock: PlayerBreakBlockBeforeEventSignal;
This event fires before a block is broken by a player.
Type: PlayerBreakBlockBeforeEventSignal
playerGameModeChange
read-only playerGameModeChange: PlayerGameModeChangeBeforeEventSignal;
Type: PlayerGameModeChangeBeforeEventSignal
Caution
This property is still in pre-release. Its signature may change or it may be removed in future releases.
playerInteractWithBlock
read-only playerInteractWithBlock: PlayerInteractWithBlockBeforeEventSignal;
Fires before a player interacts with a block.
Type: PlayerInteractWithBlockBeforeEventSignal
Caution
This property is still in pre-release. Its signature may change or it may be removed in future releases.
playerInteractWithEntity
read-only playerInteractWithEntity: PlayerInteractWithEntityBeforeEventSignal;
Fires before a player interacts with an entity.
Type: PlayerInteractWithEntityBeforeEventSignal
Caution
This property is still in pre-release. Its signature may change or it may be removed in future releases.
playerLeave
read-only playerLeave: PlayerLeaveBeforeEventSignal;
Fires when a player leaves the game.
Type: PlayerLeaveBeforeEventSignal
playerPlaceBlock
read-only playerPlaceBlock: PlayerPlaceBlockBeforeEventSignal;
This event fires before a block is placed by a player.
Type: PlayerPlaceBlockBeforeEventSignal
Caution
This property is still in pre-release. Its signature may change or it may be removed in future releases.
weatherChange
read-only weatherChange: WeatherChangeBeforeEventSignal;
Type: WeatherChangeBeforeEventSignal
Caution
This property is still in pre-release. Its signature may change or it may be removed in future releases.
worldInitialize
read-only worldInitialize: WorldInitializeBeforeEventSignal;
This event fires immediately when the script environment is initialized on a World. Not all script functionality may be available. For guaranteed access to world state, use the world initialize after event.
Type: WorldInitializeBeforeEventSignal
Caution
This property is still in pre-release. Its signature may change or it may be removed in future releases.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for