This repository was archived by the owner on May 10, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
API Wand
Legends11 edited this page Apr 18, 2026
·
1 revision
← Home
The wand/ module binds functions or commands to right-click events on carrot_on_a_stick items (or any item) tagged with minecraft:custom_data. Multiple binds can be registered to the same tag — all run in sequence.
| Function | Input | Description |
|---|---|---|
wand/register |
{tag, func} |
Bind a function to the wand tag |
wand/register_cmd |
{tag, cmd} |
Bind a command to the wand tag |
wand/unregister |
{tag} |
Remove all binds for a tag |
wand/unregister_all |
— | Remove all wand binds |
wand/give |
{player, tag, name} |
Give a wand to the player's mainhand |
wand/give_custom |
{player, item, tag, name, count} |
Give a custom item as a wand |
wand/give_lore |
{player, tag, name, lore, color} |
Give a wand with lore text |
wand/has |
{player, tag} |
Check if player holds this wand → macro:output result
|
wand/list |
— | Show all registered binds to macro.debug players |
wand/cooldown_set |
{player, tag, duration} |
Apply a cooldown to a wand |
wand/cooldown_check |
{player, tag} |
Check if wand cooldown is active → macro:output result
|
# Register a wand
data modify storage macro:input tag set value "mypack.magic_wand"
data modify storage macro:input func set value "mypack:wand/cast_spell"
function macro:api/wand/register with storage macro:input {}
# Give the wand to a player
data modify storage macro:input player set value "Steve"
data modify storage macro:input tag set value "mypack.magic_wand"
data modify storage macro:input name set value "Magic Wand"
function macro:api/wand/give with storage macro:input {}Inside the handler, @s is the player who right-clicked:
# mypack:wand/cast_spell.mcfunction
particle minecraft:end_rod ~ ~1 ~ 0.3 0.3 0.3 0.05 20
playsound minecraft:entity.enderman.teleport player @s ~ ~ ~ 1 1.5# Check cooldown before casting
data modify storage macro:input player set value "Steve"
data modify storage macro:input tag set value "mypack.magic_wand"
function macro:api/wand/cooldown_check with storage macro:input {}
execute if data storage macro:output {result:0b} run return 0 # on cooldown
# Cast and set 5-second cooldown
function mypack:wand/do_cast
data modify storage macro:input player set value "Steve"
data modify storage macro:input tag set value "mypack.magic_wand"
data modify storage macro:input duration set value 100
function macro:api/wand/cooldown_set with storage macro:input {}macro:engine
└── wand_binds
└── [{tag:"mypack.magic_wand", func:"mypack:wand/cast_spell"}]
Scoreboard: macro.rightClick (minecraft.used:minecraft.carrot_on_a_stick)
Tick: macro:core/tick/player_systems → wand/internal/tick_scan
- Default item is
carrot_on_a_stick. Usewand/give_customfor other item types. -
wand/unregister— the public wrapper has no$(var)so it appears in tab-complete. The actual macro impl is ininternal/unregister_exec. - For wands with lore, use
wand/give_lore— directlore_add/lore_removeare not supported (removed in v2.1.2).