OnUse will run the contents when the player clicks while holding the item. You can find all these parameters below.
Right now it only works on minecraft:carrot_on_a_stick item. In the future you will be able to use any/all items.
| Name |
Type |
Default Value |
Description |
| onUse |
JSON OBJECT |
|
When you click on the item it will run the code
within.
(excepted code is below) |
| onUse.add_mob_effect |
JSON OBJECT |
|
Will give the target the selected effect(s).
| Name |
Type |
Default Value |
Description |
| target |
String |
|
The target context to execute against. |
| effect |
String |
|
The minecraft effect. |
| showIcon |
Boolean |
TRUE |
Show particles/icon. |
|
| onUse.remove_mob_effect
|
JSON OBJECT |
|
Will remove the target the selected effect(s).
| Name |
Type |
Default Value |
Description |
| target |
String |
|
The target context to execute against. |
| effect |
String |
|
The minecraft effect. |
|
| onUse.die |
JSON OBJECT |
|
Will kill the target.
| Name |
Type |
Default Value |
Description |
| target |
String |
|
The target context to execute against. |
|
| onUse.transform_item |
JSON OBJECT |
|
replace the curent holding item with the new
determined
item.
| Name |
Type |
Default Value |
Description |
| transform |
String |
|
The item that will be replaced with. |
|
| onUse.replaceitem |
JSON OBJECT |
|
This will copy and move the item to the new selected
Slot.
| Name |
Type |
Default Value |
Description |
| slot |
String |
|
This is the slot the item will end up in. |
| replace |
Boolean |
|
If false it will check to see if their already is an item in that slot. |
|
| onUse.merge_data |
JSON OBJECT |
|
Will apply the data.
| Name |
Type |
Default Value |
Description |
| CustomModelData |
JSON OBJECT |
|
Replaces CustomModelData tag with value.
| Name |
Type |
Default Value |
Description |
| value |
Integer |
|
Value it will replace. |
|
| Damage |
JSON OBJECT |
|
Replaces Damage tag with value.
| Name |
Type |
Default Value |
Description |
| value |
Integer |
|
Value it will replace. |
|
| HideFlags |
JSON OBJECT |
|
Replaces HideFlags tag with value.
| Name |
Type |
Default Value |
Description |
| value |
Integer |
|
Value it will replace. |
|
| Unbreakable |
JSON OBJECT |
|
Replaces Unbreakable tag with value.
| Name |
Type |
Default Value |
Description |
| value |
Integer |
|
Value it will replace. |
|
|
| onUse.show_text |
JSON OBJECT |
|
text releated objects.
| Name |
Type |
Default Value |
Description |
| clear |
JSON OBJECT |
|
clears title, subtitle, and actionbar.
| Name |
Type |
Default Value |
Description |
| target |
String |
|
The target context to execute against. |
|
| say |
JSON OBJECT |
|
clears title, subtitle, and actionbar.
| Name |
Type |
Default Value |
Description |
| text |
String |
|
The message to display. |
|
| tellraw |
JSON OBJECT |
|
clears title, subtitle, and actionbar.
| Name |
Type |
Default Value |
Description |
| target |
String |
|
The target context to execute against. |
| raw_text |
String |
|
The JSON Formatted text to show. |
|
| title |
JSON OBJECT |
|
clears title, subtitle, and actionbar.
| Name |
Type |
Default Value |
Description |
| target |
String |
|
The target context to execute against. |
| raw_text |
String |
|
The JSON Formatted text to show. |
|
| subtitle |
JSON OBJECT |
|
clears title, subtitle, and actionbar.
| Name |
Type |
Default Value |
Description |
| target |
String |
|
The target context to execute against. |
| raw_text |
String |
|
The JSON Formatted text to show. |
|
| actionbar |
JSON OBJECT |
|
clears title, subtitle, and actionbar.
| Name |
Type |
Default Value |
Description |
| target |
String |
|
The target context to execute against. |
| raw_text |
String |
|
The JSON Formatted text to show. |
|
|
| onUse.decrement_stack |
JSON OBJECT |
|
Will remove the selected item/weapon.main hand.
| Name |
Type |
Default Value |
Description |
| gamemode |
Array |
|
A list of gamemodes that will remove the item. Put "all" for all gamemodes. |
|
| onUse.play_sound |
JSON OBJECT |
|
Will play the sound when the item is used.
| Name |
Type |
Default Value |
Description |
| target |
String |
|
The target context to execute against. |
| sound |
String |
|
The sound to play. Only some are currently supported |
|
| onUse.score |
JSON OBJECT |
|
add, remove, set scores on a scoreboard.
| Name |
Type |
Default Value |
Description |
| add |
JSON OBJECT |
|
adds score.
| Name |
Type |
Default Value |
Description |
| name |
String |
|
The target context to execute against. |
| objective |
String |
|
Objective. Must be "score.test#" 0-9. |
| amount |
Integer |
|
How much to add to score. |
|
| set |
JSON OBJECT |
|
sets score.
| Name |
Type |
Default Value |
Description |
| name |
String |
|
The target context to execute against. |
| objective |
String |
|
Objective. Must be "score.test#" 0-9. |
| amount |
Integer |
|
What to set the score to |
|
| remove |
JSON OBJECT |
|
removes score.
| Name |
Type |
Default Value |
Description |
| name |
String |
|
The target context to execute against. |
| objective |
String |
|
Objective. Must be "score.test#" 0-9. |
| amount |
Integer |
|
How much to remove from the score. |
|
|
| onUse.damage |
JSON OBJECT |
|
Will damage the target.
| Name |
Type |
Default Value |
Description |
| target |
String |
|
The target context to execute against. |
| type |
String |
|
The way to apply the damage: "EFFECT", "ARROW". |
| amount |
Integer |
|
How many half hearts to apply to target. |
|
| onUse.reload |
JSON OBJECT |
|
Will reload the server. If it is a modded server
(Spigot, Bukkit, Paper) it will run /reload confirm.
| Name |
Type |
Default Value |
Description |
| confirm |
Boolean |
FALSE |
Must be set to true for it to reload server. |
|