Skip to main content

Swim

The arc:on_swim action type is triggered when a player is swimming.

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:distance_in_cmMeasures a distance in centimeters, often used for proximity-based actions.

Example

The following example will give the player a Water Breathing effect for 10 seconds as long as they are swimming.

data/my_datapack/arc/water_breathing_on_swim.json
{
"holder": {
"type": "arc:player",
"id": "arc:player"
},
"type": "arc:on_swim",
"rewards": [
{
"type": "arc:effect",
"effect": {
"id": "minecraft:water_breathing",
"duration": 200,
"amplifier": 0,
"show_particles": false,
"show_icon": false
}
}
]
}

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: