Skip to main content

Throw Item

The arc:on_throw_item action type is triggered when a player throws an item (e.g. snowball, egg, ender pearl).

Action Data

When this action is triggered, the following action data is made available to be used by conditions and rewards:

Action Data TypeDescription
arc:item_stackRepresents a stack of items, including item type and quantity.
arc:entityRepresents an entity in the game, such as a player, mob, or item.

Example

The following example will give the player a Speed II effect every time they throw a snowball.

data/my_datapack/arc/random_throw.json
{
"holder": {
"type": "arc:player",
"id": "arc:player"
},
"type": "arc:on_throw_item",
"conditions": [
{
"type": "arc:item",
"item": {
"id": "minecraft:snowball"
}
}
],
"rewards": [
{
"type": "arc:effect",
"effect": "minecraft:speed",
"duration": 200,
"amplifier": 1
}
]
}

Compatible Condition Types

The following condition types can be used with this action type:

Compatible Reward Types

The following reward types can be used with this action type: