Item Actions (Data-Driven)
These item actions are used by the data-driven Games SDK runtime. Actions are defined in JSON and executed by the Minestom server layer when the matching trigger fires.
Triggers
use: Player uses the item in hand.use_on_block: Player uses the item on a block.consume: Player consumes the item (use action, then remove if configured).throw: Player drops the item from their hand.
Inheritance
Item definitions can extend another item and override or append actions.
json
{
"id": "flash_brew",
"extends": "base_heal_potion",
"actionMode": { "consume": "append" }
}- Use
extends(preferred) orextendsIdto reference the base item ID. - Use
actionModeper trigger:appendto add to the base list, or omit to replace.
Action Types
message
Send a chat message to the player.
Params:
text
command
Run a command as the player or console.
Params:
commandas:player(default) orconsole
give_item
Give a custom item or vanilla material.
Params:
itemId(custom item ID orminecraft:material)amount(default1)
remove_item
Consume items from the active hand.
Params:
amount(default1)
ammo
Consume ammunition from the inventory before continuing. This is a guard action that can stop further actions when ammo is missing.
Params:
itemId(oritem) ammo item ID (minecraft:arrowor custom item ID)amount(default1)cancel(defaulttrue) set tofalseto continue even when ammo is missingmessage(optional) chat text when ammo is missing
sound
Play a sound at the player.
Params:
sound(orid) sound event key, ex:minecraft:entity.player.levelupsource(optional):master,music,record,weather,block,hostile,neutral,player,ambient,voicevolume(default1)pitch(default1)custom(optionaltruefor resource-pack sounds)range(optional float, custom only)
particle
Spawn a particle at the player.
Params:
particle(orid) particle key, ex:minecraft:flashcount(default1)offsetX,offsetY,offsetZ(default0)speed(default0)longDistance(optionaltrue)overrideLimiter(optionaltrue)
heal
Restore health.
Params:
amount(float, required)
damage
Deal damage to a target entity.
Params:
amount(float, required)target(optional):target(default) orselfrange(default3.0)lineOfSight(defaulttrue)exactView(defaultfalse)includePlayers(defaultfalse)damageType(optional, defaultgeneric) minestom damage type key