Skip to main content

Get Attack Speed

The arc:get_attack_speed action type is used to retrieve the attack speed of a player.

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:itemRefers to a single item type without stack information.

Example

The following example will increase the attack speed of a player by 5x when they are holding a diamond sword in their main hand.

data/my_datapack/arc/get_attack_speed.json
{
"holder": {
"type": "arc:player",
"id": "arc:player"
},
"type": "arc:get_attack_speed",
"conditions": [
{
"type": "arc:item_in_hand",
"hand": "MAIN_HAND",
"item": {
"id": "minecraft:diamond_sword"
}
}
],
"rewards": [
{
"type": "arc:attack_speed_multiplier",
"multiplier": 0.2 // 5x attack speed (1 / 0.2 = 5)
}
]
}

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: