Developers
Game events
65 events and what they hold, for goals made from anything the game tells add-ons.
The Any game event and Any player state goals (game_event and player_state, BedrockAdvancements 2.0.14) can make a goal from anything Minecraft tells add-ons, so goals no other trigger covers don't have to wait for a new version. This page lists every event and what it holds.
#Checks
Each check is one line: what, a test and a value. What is a path into the event (or, for a player state, the player): names joined with dots, like damageSource.cause or target.location.y. All of a goal's checks must pass.
| Test | Passes when | Example |
is | its id is one of these (ids, #tags, family:s, separated by commas) | target is villager_v2, wandering_trader |
not | its id is none of them, or there's nothing there | damageSource.damagingEntity not family:undead |
= != | equal, or not: a number, true/false, or text (capitals and minecraft: don't matter) | damageSource.cause = fall |
< <= > >= | compares numbers | damage >= 10 |
exists missing | there is something there, or there isn't | itemStack exists |
Besides the names below, a path can take component:id (a mob's or item's component, e.g. target.component:variant.value for a villager's job, component:health.currentValue), property:id, tag:name (true or false), state:name (a block state: block.state:age) and effect:id (effect:speed.amplifier). Reading a path never changes anything in the game.
#Who earns it
Usually the player in the event (player, or source, entity or damageSource.damagingEntity when that's a player). When it's somewhere else, say where in Who earns it: hurtEntity for the one hurt in entityHurt. When the event is about a mob or a block, Or the nearest player within gives it to the nearest player instead: entitySpawn with entity and 16 blocks is whoever is close when a mob is born.
#Examples
{ "trigger": "game_event", "event": "entityHurt", "player": "hurtEntity", "where": ["damageSource.cause = fall", "damage >= 10"] }
{ "trigger": "game_event", "event": "playerInteractWithEntity", "where": ["target is villager_v2", "target.component:variant.value = 9"] }
{ "trigger": "game_event", "event": "entitySpawn", "player": "entity", "radius": 16, "where": ["entity is villager_v2", "cause = Born"] }
{ "trigger": "player_state", "where": ["isSneaking = true", "location.y < 0"] }
The creator checks every path against this list as you type, and warns about anything Minecraft's events don't have. An event that a later Minecraft adds works as soon as the game has it, even before this list does.
#Events
#blockContainerClosed
#blockContainerOpened
#blockExplode
#dataDrivenEntityTrigger
| Path | What it is |
|---|
entity | Entity |
eventId | string |
#effectAdd
#entityContainerClosed
#entityContainerOpened
#entityDie
#entityHeal
#entityHealthChanged
| Path | What it is |
|---|
entity | Entity |
newValue | number |
oldValue | number |
#entityHitBlock
#entityHitEntity
#entityHurt
#entityItemDrop
#entityItemPickup
#entityLoad
#entityRemove
| Path | What it is |
|---|
removedEntityId | string |
typeId | string |
#entitySpawn
#entityStartSneaking
#entityStopSneaking
#entityTamed
#entityUpgrade
| Path | What it is |
|---|
entity | Entity |
upgradeId | string |
#explosion
| Path | What it is |
|---|
dimension | Dimension |
source | Entity (may be missing) |
#gameRuleChange
| Path | What it is |
|---|
rule | GameRule: commandBlockOutput commandBlocksEnabled doDayLightCycle doEntityDrops doFireTick doImmediateRespawn doInsomnia doLimitedCrafting doMobLoot doMobSpawning doTileDrops doWeatherCycle drowningDamage fallDamage fireDamage freezeDamage functionCommandLimit keepInventory maxCommandChainLength mobGriefing naturalRegeneration playersSleepingPercentage projectilesCanBreakBlocks pvp randomTickSpeed recipesUnlock respawnBlocksExplode sendCommandFeedback showBorderEffect showCoordinates showDaysPlayed showDeathMessages showRecipeMessages showTags spawnRadius tntExplodes tntExplosionDropDecay |
value | variant |
#itemCompleteUse
#itemReleaseUse
| Path | What it is |
|---|
itemStack | ItemStack (may be missing) |
source | Player |
useDuration | number |
#itemStartUse
#itemStartUseOn
#itemStopUse
| Path | What it is |
|---|
itemStack | ItemStack (may be missing) |
source | Player |
useDuration | number |
#itemStopUseOn
#itemUse
#leverAction
| Path | What it is |
|---|
block | Block |
dimension | Dimension |
isPowered | boolean |
player | Player |
#pistonActivate
#playerBreakBlock
#playerCancelBreakingBlock
#playerDimensionChange
| Path | What it is |
|---|
fromDimension | Dimension |
fromLocation | Vector3 |
player | Player |
toDimension | Dimension |
toLocation | Vector3 |
#playerEmote
| Path | What it is |
|---|
personaPieceId | string |
player | Player |
#playerGameModeChange
| Path | What it is |
|---|
fromGameMode | GameMode: Adventure Creative Spectator Survival |
player | Player |
toGameMode | GameMode: Adventure Creative Spectator Survival |
#playerHotbarSelectedSlotChange
| Path | What it is |
|---|
itemStack | ItemStack (may be missing) |
newSlotSelected | number |
player | Player |
previousSlotSelected | number |
| Path | What it is |
|---|
newInputModeUsed | InputMode: Gamepad KeyboardAndMouse MotionController Touch |
player | Player |
previousInputModeUsed | InputMode: Gamepad KeyboardAndMouse MotionController Touch |
#playerInteractWithBlock
#playerInteractWithEntity
#playerInventoryItemChange
#playerJoin
| Path | What it is |
|---|
playerId | string |
playerName | string |
#playerLeave
| Path | What it is |
|---|
playerId | string |
playerName | string |
#playerPlaceBlock
#playerSpawn
| Path | What it is |
|---|
initialSpawn | boolean |
player | Player |
#playerStartBreakingBlock
#playerSwingStart
#pressurePlatePop
| Path | What it is |
|---|
block | Block |
dimension | Dimension |
previousRedstonePower | number |
redstonePower | number |
#pressurePlatePush
| Path | What it is |
|---|
block | Block |
dimension | Dimension |
previousRedstonePower | number |
redstonePower | number |
source | Entity |
#projectileHitBlock
#projectileHitEntity
#soundCompleted
| Path | What it is |
|---|
soundInstanceId | string |
#targetBlockHit
| Path | What it is |
|---|
block | Block |
dimension | Dimension |
hitVector | Vector3 |
previousRedstonePower | number |
redstonePower | number |
source | Entity |
#tripWireTrip
| Path | What it is |
|---|
block | Block |
dimension | Dimension |
isPowered | boolean |
sources | list of Entity (.0, .1...) |
#weatherChange
| Path | What it is |
|---|
dimension | string |
newWeather | WeatherType: Clear Rain Thunder |
previousWeather | WeatherType: Clear Rain Thunder |
#worldClockOnPaused
#worldClockOnResumed
#worldClockOnTimeMarker
#worldClockOnTimeModified
#worldLoad
#What they hold
The things events lead to, and what a path can read from each. A player is an entity too, so it has everything listed for Entity as well.
#Block
| Path | What it is |
|---|
dimension | Dimension |
isAir | boolean |
isLiquid | boolean |
isValid | boolean |
isWaterlogged | boolean |
localizationKey | string |
location | Vector3 |
permutation | BlockPermutation |
type | BlockType |
typeId | string |
x | number |
y | number |
z | number |
#BlockPermutation
| Path | What it is |
|---|
localizationKey | string |
type | BlockType |
#BlockPistonComponent
| Path | What it is |
|---|
isValid | boolean |
typeId | string |
block | Block |
isMoving | boolean |
state | BlockPistonState: Expanded Expanding Retracted Retracting |
#BlockType
| Path | What it is |
|---|
id | string |
localizationKey | string |
#ContainerAccessSource
| Path | What it is |
|---|
entity | Entity (may be missing) |
#Effect
| Path | What it is |
|---|
amplifier | number |
displayName | string |
duration | number |
isValid | boolean |
typeId | string |
#Entity
| Path | What it is |
|---|
dimension | Dimension |
id | string |
isClimbing | boolean |
isFalling | boolean |
isInWater | boolean |
isOnGround | boolean |
isSleeping | boolean |
isSneaking | boolean |
isSprinting | boolean |
isSwimming | boolean |
isValid | boolean |
localizationKey | string |
location | Vector3 |
nameplateDepthTested | boolean |
nameplateRenderDistance | number |
nameTag | string |
scoreboardIdentity | ScoreboardIdentity (may be missing) |
typeId | string |
#EntityDamageSource
| Path | What it is |
|---|
cause | EntityDamageCause: anvil blockExplosion campfire charging contact drowning entityAttack entityExplosion fall fallingBlock fire fireTick fireworks flyIntoWall freezing lava lightning maceSmash magic magma none override piston projectile ramAttack selfDestruct sonicBoom soulCampfire stalactite stalagmite starve suffocation temperature thorns void wither |
damagingEntity | Entity (may be missing) |
damagingProjectile | Entity (may be missing) |
#EntityHealSource
| Path | What it is |
|---|
cause | EntityHealCause: Heal Regeneration SelfHeal TotemOfUndying |
#ItemStack
| Path | What it is |
|---|
amount | number |
isStackable | boolean |
keepOnDeath | boolean |
localizationKey | string |
lockMode | ItemLockMode: inventory none slot |
maxAmount | number |
nameTag | string (may be missing) |
type | ItemType |
typeId | string |
weight | number |
#ItemType
| Path | What it is |
|---|
id | string |
localizationKey | string |
#Player
| Path | What it is |
|---|
dimension | Dimension |
id | string |
isClimbing | boolean |
isFalling | boolean |
isInWater | boolean |
isOnGround | boolean |
isSleeping | boolean |
isSneaking | boolean |
isSprinting | boolean |
isSwimming | boolean |
isValid | boolean |
localizationKey | string |
location | Vector3 |
nameplateDepthTested | boolean |
nameplateRenderDistance | number |
nameTag | string |
scoreboardIdentity | ScoreboardIdentity (may be missing) |
typeId | string |
camera | Camera |
clientSystemInfo | ClientSystemInfo |
commandPermissionLevel | CommandPermissionLevel: 2 0 1 3 4 |
fogSettings | FogSettings |
graphicsMode | GraphicsMode: Deferred Fancy RayTraced Simple |
inputInfo | InputInfo |
inputPermissions | PlayerInputPermissions |
isEmoting | boolean |
isFlying | boolean |
isGliding | boolean |
isJumping | boolean |
level | number |
locatorBar | LocatorBar |
name | string |
onScreenDisplay | ScreenDisplay |
playerPermissionLevel | PlayerPermissionLevel: 3 1 2 0 |
selectedSlotIndex | number |
totalXpNeededForNextLevel | number |
xpEarnedAtCurrentLevel | number |
#TimeMarker
| Path | What it is |
|---|
name | string |
period | number (may be missing) |
time | number |
#Vector3
| Path | What it is |
|---|
x | number |
y | number |
z | number |
#WorldClock
| Path | What it is |
|---|
isPaused | boolean |
name | string |
time | number |
timeMarkers | list of TimeMarker (.0, .1...) |
From Minecraft's Script API metadata, @minecraft/server 2.11.0.