đ§ Functions
cancel_eventâ
Cancel the original event.
type: cancel_event
runâ
Run a list of functions in order. It's useful for functions that share the same conditions.
type: run
delay: 0 # optional; number; default: 0
functions: # required; maplist
- type: command
- type: message
commandâ
Run a command as a player, console or event.
type: command
command: "say hello <arg:player.name>" # required; stringlist/string
target: "self" # optional; enum[all, self]/player selector; default: self
# Execute the command as a player.
as_player: false # optional; boolean; default: false
# Run as OP (Not Recommended). This is a potential security risk. For safety, run the command from the console.
as_op: false # optional; boolean; default: false
# Some custom command plugins are event-based and may require this option to execute custom commands.
as_event: false # optional; boolean; default: false
messageâ
Send a message/system actionbar message
type: message
message: "Hello <papi:player_name>" # required; string list/string
target: "self" # optional; enum[all, self]/player selector
overlay: false # optional; default: false; false = chat box / true = actionbar
actionBarâ
Send an actionbar
type: actionbar
actionbar: "This is an action bar" # required; string
target: "self" # optional; enum[all, self]/player selector; default: self
Titleâ
Send a title
type: title
title: "<red>Title</red>" # required; string
subtitle: "<Yellow>Subtitle</yellow>" # required; string
fade_in: 20 # optional; number; default: 10
stay: 10 # optional; number; default: 20
fade_out: 10 # optional; number; default: 5
open_windowâ
Open a gui window
type: open_window #
gui_type: anvil # required; enum[anvil, enchantment, grindstone, loom, smithing, crafting, cartography];
title: "Super Anvil" # optional; string
target: "self" # optional; enum[all, self]/player selector; default: self
break_blockâ
Break a block
type: break_block
x: <arg:position.x> # å¯é; æ°å; éģ莤åŧ: <arg:position.x>
y: <arg:position.y> # å¯é; æ°å; éģ莤åŧ: <arg:position.y>
z: <arg:position.z> # å¯é; æ°å; éģ莤åŧ: <arg:position.z>
place_blockâ
Place a block
type: place_block
block_state: "default:chinese_lantern" # required; string
x: <arg:block.block_x> # optional; number; default: <arg:position.x>
y: <arg:block.block_y> # optional; number; default: <arg:position.y>
z: <arg:block.block_z> # optional; number; default: <arg:position.z>
update_block_propertyâ
Update the properties of an existing block
type: update_block_property
properties: # required; key-value pair
axis: x
age: 7
x: <arg:block.block_x> # optional; number; default: <arg:position.x>
y: <arg:block.block_y> # optional; number; default: <arg:position.y>
z: <arg:block.block_z> # optional; number; default: <arg:position.z>
transform_blockâ
Transform the current block into another one, with properties preserved
type: transform_block
block: default:palm_log # required
properties: # optional; key-value pair
property_a: b
x: <arg:block.block_x> # optional; number; default: <arg:position.x>
y: <arg:block.block_y> # optional; number; default: <arg:position.y>
z: <arg:block.block_z> # optional; number; default: <arg:position.z>
drop_lootâ
Drop loots based on the give loot table
type: drop_loot
x: <arg:block.block_x> + 0.5 # optional; number; default: <arg:position.x>
y: <arg:block.block_y> + 0.5 # optional; number; default: <arg:position.y>
z: <arg:block.block_z> + 0.5 # optional; number; default: <arg:position.z>
to_inventory: false
loot:
pools: ...
update_interaction_tickâ
Update the tick when the last interaction ends
type: update_interaction_tick
set_countâ
Set the count of the current item in this event
type: set_count
add: true # default: false
count: -1 # required; number
target: "self" # optional; enum[all, self]/player selector
set_foodâ
Set the food level (0~20) of the player
type: set_food
add: true # optional; boolean; default: false
food: 4 # required; number
target: "self" # optional; enum[all, self]/player selector
set_saturationâ
Set the saturation(0~10) of the player
type: set_saturation
add: true # optional; boolean; default: false
saturation: 2.5 # required; number
target: "self" # optional; enum[all, self]/player selector
swing_handâ
Swing the hand involved in this event or the hand specified in config
type: swing_hand
hand: main_hand # optional; enum[main_hand, off_hand]; leave it empty to swing the hand in this context
particleâ
Spawn a particle, For specific parameters, see ⨠Particle Effects
type: particle
particle: minecraft:end_rod # required; string
x: "<arg:position.x>" # optional; number; default: <arg:position.x>
y: "<arg:position.y>" # optional; number; default: <arg:position.y>
z: "<arg:position.z>" # optional; number; default: <arg:position.z>
count: 5 # optional; number; default: 1
offset_x: 0.3 # optional; number; default: 0
offset_y: 0.3 # optional; number; default: 0
offset_z: 0.3 # optional; number; default: 0
speed: 0 # optional; number; default: 0
potion_effectâ
Add a potion effect
type: potion_effect
potion_effect: minecraft:blindness # required; string
duration: 20 # optional; number; default: 20
amplifier: 0 # optional; number; default: 0
ambient: false # optional; boolean; if the effect is given by beacon
particles: true # optional; boolean
show_icon: true # optional; boolean
remove_potion_effectâ
Remove a potion effect
type: remove_potion_effect
potion_effect: minecraft:blindness # optional if 'all' is true; boolean
all: false # optional; boolean; default: false
leveler_expâ
Add skill/job experience
type: leveler_exp
plugin: AuraSkills # required; string
leveler: fishing # required; string; the job/skill id
count: 10 # required; number
set_cooldownâ
Set cooldown for player
type: set_cooldown
time: 1m30s
id: my_cooldown_id # required; string
add: false # optional; boolean; default: false (Whether to accumulate cooldown time)
remove_cooldownâ
Remove cooldown for player
type: remove_cooldown
id: my_cooldown_id # optional if 'all' is true; string
all: false # optional; boolean; default: false
play_soundâ
Play a sound
type: play_sound
sound: minecraft:xxxx.xxx
x: <arg:position.x> # optional if 'target' is specified; number
y: <arg:position.y> # optional if 'target' is specified; number
z: <arg:position.z> # optional if 'target' is specified; number
target: "self" # optional; enum[all, self]/player selector
pitch: 1 # optional; number; default: 1
volume: 1 # optional; number; default: 1
source: master # optional; enum[music, master, record, weather, block, hostile, neutral, player, ambient, voice, ui]; default: master
cast_mythic_skillâ
Cast a mythic mobs skill
type: cast_mythic_skill
skill: skill_id # required; string
power: 1.0 # optional; number; default: 1.0
parameters: # optional; MythicMobs skill parameters, available as <skill.parameter_name>
damage: 10
element: "<arg:element>"
variables: # optional; skill-scoped MythicMobs variables, available as <skill.var.variable_name>
damage: 10 # scalar values infer INTEGER, FLOAT, DOUBLE, or STRING
element: "<arg:element>"
multiplier: # use the expanded form to specify a type
type: double
value: "<arg:multiplier>"
spawn_furnitureâ
Spawn a furniture
type: spawn_furniture
furniture_id: "default:bench" # required; string
x: <arg:position.x> # optional; number; default: <arg:position.x>
y: <arg:position.y> # optional; number; default: <arg:position.y>
z: <arg:position.z> # optional; number; default: <arg:position.z>
pitch: <arg:position.pitch> # optional; number; default: <arg:position.pitch>
yaw: <arg:position.yaw> # optional; number; default: <arg:position.yaw>
variant: ground # optional;
play_sound: true # optional; boolean; default: true
remove_furnitureâ
Remove a furniture
type: remove_furniture
drop_loot: true # optional; boolean; default: true
play_sound: true # optional; boolean; default: true
replace_furnitureâ
Replace a furniture
type: replace_furniture
furniture_id: "default:bench"
x: <arg:furniture.x> # required; number; default: <arg:furniture.x>
y: <arg:furniture.y> # required; number; default: <arg:furniture.y>
z: <arg:furniture.z> # required; number; default: <arg:furniture.z>
pitch: <arg:furniture.pitch> # required; number; default: <arg:furniture.pitch>
yaw: <arg:furniture.yaw> # required; number; default: <arg:furniture.yaw>
variant: ground # optional; string
drop_loot: true # default: true
play_sound: true # default: true
rotate_furnitureâ
Rotate a furniture. Sometimes furniture cannot be rotated due to collision shape, at which point the on_failure event will be triggered.
type: rotate_furniture
degree: 90
on_success: [] # functions
on_failure: [] # functions
teleportâ
Teleport to a certain location
type: teleport
x: <arg:position.x> # required; number
y: 100 # required; number
z: <arg:position.z> + 5 # required; number
pitch: <arg:player.pitch> # optional; default: 0
yaw: <arg:player.yaw> # optional; default: 0
world: world # optional; string
toastâ
Send a toast
type: toast
toast: This is a toast # required; string
advancement_type: goal # optional; enum[goal,task,challenge]; default: goal
icon: minecraft:stone # required; string
damageâ
Damage the target
type: damage
target: self # optional; enum[all, self]/player selector; default: self
amount: 1.0 # optional; number; default: 1.0
damage_type: generic # optional; string; default: generic
set_variableâ
Set a variable on the current execution context. Functions that run later with the same context can read it with <var:name>.
type: set_variable
name: my_variable # required; string
value_type: double # optional; enum[int, double, string]
value: 1.0 # required unless number/text is used; number for int/double, string for string
value_type controls the stored Java value:
| Value type | Result | Accepted value |
|---|---|---|
| int | Integer; numeric results are floored | Number Format |
| double | Double | Number Format |
| string | String | Text; context tags such as <arg:...> and <var:...> are supported |
number remains an alias for a numeric value, and text remains an alias for a string value. If value_type is omitted, configurations using number default to double; all other configurations default to string.
Variables belong to the current context. They are not global or persistent, and are available only to later conditions, functions, and text rendering that share that context.
type: run
functions:
- type: set_variable
name: reward
value_type: int
value: "<arg:player.level> / 5"
- type: message
message: "<green>You received <var:reward> coins."
merchant_tradeâ
Create a custom villager trading shop
type: merchant_trade
title: "Custom Merchant"
offers:
- cost_1:
item: iron_pickaxe
# optional custom component predicates
components:
minecraft:enchantments:
minecraft:unbreaking: 1
# cost_2 is optional
cost_2:
item: cobblestone
# optional count
count: 8
result:
item: default:topaz
count: 4
# add more trade offers
- cost_1: stone
result: default:topaz
# optional
experience: 3
remove_entityâ
Remove the entity in this context
type: remove_entity
if_elseâ
Run the first function that meets the specified conditions.
type: if_else
rules:
- conditions:
- type: permission
permission: group.admin
functions:
- type: command
command: say hello admin
- conditions:
- type: permission
permission: group.vip
functions:
- type: command
command: say hello vip
- functions:
- type: command
command: say hello player
whenâ
Evaluate a source value and executes the functions of the first matching case. It's similar to a switch-case statement in programming languages.
type: when
source: <papi:player_world>
cases:
- when: "world"
functions:
- type: message
message: "You are in the overworld."
- when:
- "world_nether"
- "world_the_end"
functions:
- type: message
message: "You are in a dangerous dimension!"
# optional
fallback:
- type: message
message: "You are in an unknown world."
damage_itemâ
Consume the durability of the item currently held by the player in the current context.
type: damage_item
amount: 1 # optional; number; default: 1
slot: mainhand # optional; enum[mainhand, offhand, feet, legs, chest, head]
cycle_block_propertyâ
Cycle the value of a block property
type: cycle_block_property
property: axis # required; string
inverse: <arg:player.is_sneaking> # optional; number; default: <arg:player.is_sneaking>
x: <arg:block.block_x> # optional; number; default: <arg:position.x>
y: <arg:block.block_y> # optional; number; default: <arg:position.y>
z: <arg:block.block_z> # optional; number; default: <arg:position.z>
You can also define a custom cycle sequence with specific rules.
type: cycle_block_property
property: facing # required; string
x: <arg:block.block_x> # optional; number; default: <arg:position.x>
y: <arg:block.block_y> # optional; number; default: <arg:position.y>
z: <arg:block.block_z> # optional; number; default: <arg:position.z>
rules:
north: east
east: south
south: west
west: north
set_expâ
Set the experience point of the player
type: set_exp
count: 1 # required; number
add: true # optional; boolean; default: false
target: "self" # optional; enum[all, self]/player selector; default: self
set_levelâ
Set the experience level of the player
type: set_level
count: 1 # required; number
add: true # optional; boolean; default: false
target: "self" # optional; enum[all, self]/player selector; default: self
play_totem_animationâ
Play the totem animation
type: play_totem_animation
item: "default:topaz" # required; string
sound: minecraft:entity.player.levelup # optional; string
pitch: 1 # optional; number; default: 1
volume: 1 # optional; number; default: 1
silent: false # optional; boolean; default: false
target: "self" # optional; enum[all, self]/player selector; default: self
close_inventoryâ
Close the current inventory
type: close_inventory
target: "self" # optional; enum[all, self]/player selector; default: self
discover_recipeâ
Unlock a recipe for the player. Supports vanilla recipes and custom recipes registered on the server.
type: discover_recipe
recipe: "mypack:custom_recipe" # required; string; recipe ID; alias: id
target: "self" # optional; enum[all, self]/player selector; defaults to the context player
clear_itemâ
Clear items from the player's inventory
type: clear_item
id: "default:topaz" # required; string
count: 1 # optional; number; default: 1
healâ
Heal the player
type: heal
amount: 1.0 # optional; number; default: 1.0
target: "self" # optional; enum[all, self]/player selector; default: self
take_moneyâ
Take money from the player (requires Vault and an economy plugin). Nothing happens if the player's balance is insufficient.
type: take_money
amount: 100 # required; number/expression
target: "self" # optional; enum[all, self]/player selector; default: self
give_moneyâ
Give money to the player (requires Vault and an economy plugin)
type: give_money
amount: 100 # required; number/expression
target: "self" # optional; enum[all, self]/player selector; default: self
spawn_mythic_mobâ
Spawn a mythic mob
type: spawn_mythic_mob
mob: "test_mob" # required; string
level: 1.0 # optional; number; default: 1.0
world: "world" # optional; string
x: "<arg:position.x>" # optional; number; default: <arg:position.x>
y: "<arg:position.y>" # optional; number; default: <arg:position.y>
z: "<arg:position.z>" # optional; number; default: <arg:position.z>
pitch: "<arg:position.pitch>" # optional; number; default: <arg:position.pitch>
yaw: "<arg:position.yaw>" # optional; number; default: <arg:position.yaw>
set_furniture_variantâ
Sets the variant of a furniture
type: set_furniture_variant
variant: a_variant # required; string
set_item_cooldown (1.21.2+)â
Sets the cooldown for a specific item for the player
type: set_item_cooldown
id: "minecraft:ender_pearl" # required; string; cooldown group
time: "5s" # required; string; supports unit combinations: t(tick), s(second), m(minute), h(hour), d(day), w(week)
add: false # optional; boolean; default: false
transferâ
Transfer a player to another server. Supports both proxy plugin messaging (BungeeCord / Velocity) and Minecraft native transfer.
# Proxy plugin message â by server name (BungeeCord / Velocity)
type: transfer
server: "lobby" # required if host not set; string
# Direct transfer â by host + port
type: transfer
host: "lobby.example.com" # required if server not set; string
port: 25566 # optional; number; default: 25565
jsâ
Invokes a JavaScript function. See đ Scripting for the full scripting guide.
type: js
script: "mypack:combo" # required; string; script id (<namespace>:<path without .js>)
function: "onRightClick" # required; string; the function to invoke
# args - optional; list or map
# List form: injected as the `args` binding
# args: [ "a", "b" ]
# Map form: each entry is injected as a binding of the same name
args:
combo: "combo_a"
times: 3
More functions are coming...