#running functions for plugin custom items

1 messages · Page 1 of 1 (latest)

twilit anchor
#

so i wanna make a function for example when a player is holding this item he gets a effect but i wanna do it with custom items from a plugin. would that be possible? also the plugin im using is mythic mobs if that helps

woeful helm
#

yes you can, the exact syntax depends on the item. For both vanilla and modded items, it is usually easy to first from chat do a /data get entity @s SelectedItem while holding said item in your mainhand to see what the item nbt looks like.

if the item has its own id you can simply check for that id and it would be enough. Some mods/plugins or items might have more components or data on it that you want to check to make sure it is the right type of item.

in a function that you added to tick.json you can check if a player has a specific item in their mainhand and then run some command or function by doing:
execute as @a if items entity @s weapon.mainhand * run ...

twilit anchor
#

Perfect thx