Built-in actions
This is an exhaustive list of all actions provided by UnderscoreEnchants as of v2.2. You are expected to be familiar with the syntax of actions and how to work with them, as outlined in the enchantments guide.
air
Info
Sets entity's remaining air ticks, clamping it between 0 and 2147483647.
Aliases: set-air
, remaining-air
, set-remaining-air
Arguments:
- The air in ticks (1 tick = 0.05 seconds)
Example:
- air 500
This action is marked as stable as of 2.2.
apply-velocity
Info
Applies velocity to an entity.
Aliases: velocity
Arguments:
- The
X
value of the velocity to apply - The
Y
value of the velocity to apply - The
Z
value of the velocity to apply
Example:
apply-velocity 0 0.75 0
This action is marked as stable as of 2.2.
attribute
Info
Sets the value of an attribute for the target entity.
Aliases: set-attribute
, attr
, set-attr
, attribute-value
, attr-value
, set-attribute-value
, set-attr-value
Arguments:
- The attribute name
- The new value (use
default
to reset the value to default)
Example:
attr generic_movement_speed 6
This action is marked as stable as of 2.2.
bed
Info
Teleports the player to their bed location.
Aliases: tp-bed
, teleport-bed
, bed-tp
, bed-teleport
, tp-to-bed
, teleport-to-bed
This action is marked as stable as of 2.2.
break
Info
Breaks a block naturally with the item that the player is holding.
Aliases: break-block
Arguments:
- The X coordinate of the block
- The Y coordinate of the block
- The Z coordinate of the block
- (optional) The world name, defaults to the player's world if not specified
Example:
break 0 65 0 world
This action is marked as stable as of 2.2.
broadcast
Info
Broadcasts a message server-wide.
Aliases: broadcast-message
, servermessage
, server-message
, allmessage
, all-message
Arguments:
- The message to broadcast
Example:
broadcast The server enchantment system is powered by UnderscoreEnchants!
This action is marked as stable as of 2.2.
cancel
Info
Cancels the event. This will fail silently if the event is not cancellable.
Aliases: undo
This action is marked as stable as of 2.2.
console-command
Info
Executes a command on behalf of the console.
Aliases: console
, elevated-command
, admin-command
Arguments:
- The command to execute
Example:
console-command kickall
This action is marked as stable as of 2.2.
create-world
Info
Creates and loads a new world, or loads an existing one.
Aliases: load-world
Arguments:
- The world type to use
- The settings for the generator (put
-1
to use the defalt settings) - The name of the world with no spaces
Example:
create-world AMPLIFIED -1 new_world
This action is marked as stable as of 2.2.
damage
Info
Damages an entity on behalf of some player. Does not deal true damage (accounts for armor, effects, etc).
Aliases: dmg
, attack
Arguments:
- The amount of damage to deal
- The name of an online player
Example:
dmg <placeholder=rndint:arguments={lowerBound=1|upperBound=3}> <name>
This action is marked as stable as of 2.2.
damage-item
Info
Damages the player's item by a certain amount.
Arguments:
- The slot in which the item resides
- The amount (if a negative amount is specified, the item will be repaired by that amount instead)
Example:
damage-item chestplate 2
This action is marked as stable as of 2.2.
direction
Info
Changes the entity's yaw and pitch.
Aliases: change-direction
, dir
, change-dir
Arguments:
- Yaw
- Pitch
Example:
dir 58.4 -90
This action is marked as stable as of 2.2.
drop-hand
Info
Drops the player's main hand/off hand item at their location.
Aliases: drop-hand-item
Arguments:
- The hand (start with
m
for main hand, anything else for off hand) - Whether to drop the entire stack or just one item from the stack (start with
f
for full stack, anything else for one item)
Example:
drop-hand m f
This action is marked as stable as of 2.2.
drop-item
Info
Drops an item at a location.
Aliases: drop-item-world
, drop-item-in-world
Arguments:
- The item in the standard item format
- The X coordinate of the location
- The Y coordinate of the location
- The Z coordinate of the location
- The world name
Example:
drop-item DIAMOND 30 120 -801 world
This action is marked as stable as of 2.2.
effect
Info
Adds an effect to an entity.
Aliases: add-effect
Arguments:
- The effect name
- The duration in ticks (1 tick = 0.05 seconds)
- The amplifier
Example:
effect DARKNESS 200 1
This action is marked as stable as of 2.2.
fake-lightning
Info
Strikes a fake lightning at the entity's position.
Aliases: strike-fake-lightning
This action is marked as stable as of 2.2.
fire
Info
Sets the entity on fire.
Aliases: set-fire
, fire-ticks
, set-fire-ticks
Arguments:
- The amount of time in ticks (1 tick = 0.05 seconds)
Example:
fire 500
This action is marked as stable as of 2.2.
food
Info
Sets the player's food level, clamping it between 0 and 20.
Aliases: set-food
, satiety
, set-satiety
Arguments:
- The food level
Example:
food 15
This action is marked as stable as of 2.2.
forward
Info
Throws the entity forward a certain amount of blocks, or until the path is obstructed. Note that the amount of blocks is an approximation and the result might be a bit further or closer than expected.
Aliases: go-forward
, teleport-forward
, dash
Arguments:
- The amount of blocks (any positive number)
Example:
forward 4.5
This action is marked as stable as of 2.2.
gamemode
Info
Sets the player's gamemode
Aliases: gm
, set-gamemode
, set-gm
, change-gamemode
, change-gm
Arguments:
- The gamemode, either as a string (
survival
/creative
/etc), or as a number (0
for survival,1
for creative, etc)
Example:
gm 0
This action is marked as stable as of 2.2.
give
Info
Gives an item to the player. If there is no free space in their inventory, it will be dropped at their location.
Aliases: give-item
, item-give
Arguments:
- The item
Example:
give DIAMOND
This action is marked as stable as of 2.2.
hand
Info
Sets the player's main hand/off hand item.
Aliases: set-hand
Arguments:
- The hand (start with
m
for main hand, anything else for off hand) - The item
Example:
hand m DIAMOND
heal
Info
Heals the entity to their maximum HP.
Aliases: restore
This action is marked as stable as of 2.2.
hp
Info
Sets entity's health.
Aliases: set-hp
, health
, set-health
Arguments:
- The amount of HP, clamping it between 0 and the entity's max health
Example:
hp 306
This action is marked as stable as of 2.2.
launch-arrow
Info
Sends an arrow in the direction that the entity is looking.
Aliases: arrow
, send-arrow
This action is marked as stable as of 2.2.
launch-fireball
Info
Sends a fireball in the direction that the entity is looking.
Aliases: fireball
, send-fireball
This action is marked as stable as of 2.2.
level
Info
Sets the player's current level, clamping it between 0 and 2147483647.
Aliases: set-level
, current-level
, set-current-level
, lvl
, set-lvl
, current-lvl
, set-current-lvl
Arguments:
- The level
Example:
level 15
This action is marked as stable as of 2.2.
lightning
Info
Strikes a lightning at the entity's current position.
Aliases: strike-lightning
This action is marked as stable as of 2.2.
location-sound
Info
Plays a sound at a location.
Aliases: place-sound
, world-sound
Arguments:
- The sound name
- The X coordinate of the location
- The Y coordinate of the location
- The Z coordinate of the location
- The world name
Example:
place-sound ENTITY_ENDERMAN_SCREAM 50 120 -801 world
This action is marked as stable as of 2.2.
max-hp
Info
Sets entity's max health.
Aliases: set-max-hp
, max-health
, set-max-health
Arguments:
- The amount of max HP
Example:
max-hp 306
This action is marked as stable as of 2.2.
money
Info
Sets player's balance, either using Treasury's or Vault's economy (whichever is present, with Treasury taking the priority if both are). If none of them are present, silently fails.
Aliases: set-money
Arguments:
- The balance
Example:
money 31038
This action is marked as stable as of 2.2.
particle
Info
Spawns a particle at the entity's location.
Aliases: spawn-particle
Arguments:
- The particle name
Example:
particle SUSPENDED_DEPTH
This action is marked as stable as of 2.2.
particle-head
Info
Spawns a particle at the entity's head location.
Aliases: particle-eyes
, spawn-particle-eyes
, spawn-particle-head
Arguments:
- The particle name
Example:
particle-head SUSPENDED_DEPTH
This action is marked as stable as of 2.2.
pdc
Info
Adds a key-value pair to the entity's PDC (persistent data container). Every value is treated as a string.
Aliases: set-pdc
Arguments:
- The key
- The value
Example:
pdc MyServerRank VIP
This action is marked as stable as of 2.2.
player-actionbar
Info
Sends a message to the player via actionbar.
Aliases: actionbar
, send-actionbar
Arguments:
- The message to send
Example:
actionbar You are DOOMED!
This action is marked as stable as of 2.2.
player-bossbar
Info
Spawns a bossbar and displays it to the player.
Aliase: bossbar
, send-bossbar
Arguments:
- The bar color
- The bar style
- The duration in ticks that the bossbar should last (1 tick = 0.05 seconds)
- The message to display at the bossbar
Example:
bossbar yellow solid 160 You are DOOMED!
This action is marked as stable as of 2.2.
player-chat
Info
Sends a message/commands on the player's behalf.
Aliases: chat
, say
Arguments:
- The message to send
Example:
chat You are DOOMED!
This action is marked as stable as of 2.2.
player-message
Info
Sends a message to the player via chat.
Aliases: message
, send-message
, msg
Arguments:
- The message to send
Example:
msg You are DOOMED!
This action is marked as stable as of 2.2.
player-subtitle
Info
Sends a message to the player via subtitle.
Aliases: subtitle
, send-subtitle
Arguments:
- The amount of ticks for the subtitle to fade in (1 tick = 0.05 seconds)
- The amount of ticks for the subtitle to stay
- The amount of ticks for the subtitle to fade out
- The message to send
Example:
subtitle 40 100 40 You are DOOMED!
This action is marked as stable as of 2.2.
player-time
Info
Sets the player's personal time.
Aliases: player-set-time
Arguments:
- The time
- Whether the time should be relative (
true
) to the server time, or fixed (false
)
Example:
player-time 15000 true
This action is marked as stable as of 2.2.
player-title
Info
Sends a message to the player via title.
Aliases: title
, send-title
Arguments:
- The amount of ticks for the title to fade in (1 tick = 0.05 seconds)
- The amount of ticks for the title to stay
- The amount of ticks for the title to fade out
- The message to send
Example:
title 40 100 40 You are DOOMED!
This action is marked as stable as of 2.2.
player-weather
Info
Sets the player's personal weather.
Aliases: player-set-weather
Arguments:
- The weather (either
rain
orclear
)
Example:
player-weather rain
This action is marked as stable as of 2.2.
remove-buffs
Info
Removes all positive effects from an entity.
Aliases: take-buffs
This action is marked as stable as of 2.2.
remove-debuffs
Info
Removes all negative effects from an entity.
Aliases: take-debuffs
This action is marked as stable as of 2.2.
remove-effect
Info
Removes an effect from an entity.
Aliases: take-effect
Arguments:
- The effect name
Example:
remove-effect DARKNESS
This action is marked as stable as of 2.2.
reset-max-hp
Info
Resets the entity's max health.
Aliases: reset-max-health
This action is marked as stable as of 2.2.
reset-player-time
Info
Resets player's perosonal time and synchronizes it back with the world time.
This action is marked as stable as of 2.2.
reset-player-weather
Info
Resets player's perosonal weather and synchronizes it back with the world weather.
This action is marked as stable as of 2.2.
satiate
Info
Satiates the player.
This action is marked as stable as of 2.2.
set-block
Info
Sets a block at a location.
Aliases: place-block
Arguments:
- The block type
- The X coordinate of the location
- The Y coordinate of the location
- The Z coordinate of the location
- The world name
Example:
set-block DIAMOND_BLOCK 50 120 -801 world
This action is marked as stable as of 2.2.
shuffle-hotbar
Info
Shuffles the player's hotbar.
Aliases: shuffle-bar
, hotbar-shuffle
This action is marked as stable as of 2.2.
shuffle-inventory
Info
Shuffles the player's inventory.
Aliases: inv-shuffle
, inventory-shuffle
, shuffle-inv
This action is marked as stable as of 2.2.
skull
Info
Gives the player a skull of the specified player. If there's no free space in the player's inventory, it will be dropped at their location.
The behavior of this action is unknown if your server is running with online-mode=false
.
Aliases: give-skull
Arguments:
- The name of the player, or a selector (e.g.
@p
) if the selector only returns one player
Example:
skull Notch
This action is marked as stable as of 2.2.
sound
Info
Plays a sound to an entity.
Aliases: play-sound
Arguments:
- The sound name
Example:
sound ENTITY_ENDERMAN_SCREAM
This action is marked as stable as of 2.2.
spawn-entity
Info
Spawns an entity at a location.
Aliases: create-entity
, build-entity
Arguments:
- The entity type
- The X coordinate of the location
- The Y coordinate of the location
- The Z coordinate of the location
- The world name
This action takes extra optional parameters.
- To set the entity's initial health, use
HEALTH=<health>
- To give the entity some effects, use this syntax:
EFFECTS=<effect_name>;<duration>;<amplifier>|<effect_name>;...
(find effect names here) - To set the entity's name, use
NAME=<name>
with no spaces (use underscores (_
) if you need spaces, they will be replaced with spaces)
Example:
spawn-entity ENDERMAN 50 120 -801 world HEALTH=47.5 EFFECTS=INCREASE-DAMAGE;-1;2|DAMAGE-RESISTANCE;-1;5 NAME=My_Pal
This action is marked as stable as of 2.2.
statistic
Info
Sets the player's statistic.
Aliases: set-statistic
, stat
, set-stat
, statistic-value
, stat-value
, set-statistic-value
, set-stat-value
Arguments:
- The statistic name
- The value
Example:
stat deaths 6
This action is marked as stable as of 2.2.
time
Info
Sets time at a world.
Aliases: change-time
, set-time
Arguments:
- The time
- The world name
Example:
time 12000 world
This action is marked as stable as of 2.2.
tp
Info
Teleports the entity to a certain location.
Aliases: teleport
Arguments:
- The X coordinate of the location
- The Y coordinate of the location
- The Z coordinate of the location
- The world name
If you do not specify the world name, it'll be assumed that the teleportation should take place in the same world that the entity is in.
If you do not specify any coordinates and only the world name, the entity will be teleported to the spawnpoint of that world.
Example:
tp 581 110 -303
This action is marked as stable as of 2.2.
weather
Info
Sets weather at a world.
Aliases: set-weather
, change-weather
Arguments:
- The weather (start with
s
for sun,r
for rain andt
for thunder) - The world name
Example:
weather s world
This action is marked as stable as of 2.2.
xp
Info
Sets the player's current experience, clamping it between 0 and 2147483647
Aliases: exp
, set-exp
, current-exp
, set-current-exp
, set-xp
, current-xp
, set-current-xp
Arguments:
- The amount of experience
Example:
xp 15
This action is marked as stable as of 2.2.