- Denizen Version
- 1.2.9-b1800-REL
Dmmo - External plugin item saver tool
This script is a tool designed for saving items that would otherwise be a headache to convert into Denizen items via item script containers, to be used within Denizen scripts more simply. Plugins such as MMOItems Utilize internal NBT data which can be read with the Itemtag.all_raw_nbt tag, but that's a spaghettified mess and not very legible, especially for newbies. To use this command, ensure that you have the permissiondenizen.dmmo
(or OP preferably, having said that Denizen is essentially operators permission anyways), And use the command using the syntax provided below and within the script.Do note that this script is not for checking whether an item is a custom item from another plugin as opposed to a specific item that you manually save using this command; Likewise, if you are going to change configuration options or data on a specific item from another plugin after having saved it initially with this command, you are responsible for updating your saved data afterwards.
Command syntax:
/dmmo [name]
| Saves the item in your hand as "[name]
"/dmmo [name] remove
| Removes the saved item named "[name]
"/dmmo list
| Lists all of the currently saved dmmo itemsTo use within scripts:
Tag usage:<server.flag[behr.denizen.dmmo_items.<[item_name]>]>
Example:
<server.flag[behr.denizen.dmmo_items.my_fancy_item]>
Returns:
ItemTag
of the saved item.When comparing it to other items, use the item's flag name
dmmo_name
Example 1:
Code:
- define my_held_item <player.item_in_hand>
- if <[my_held_item].flag[dmmo_name].if_null[null]> == my_fancy_item:
- narrate "You're holding my fancy item!
Code:
on player clicks block:
- define item_clicked_with <context.item>
- if <[item_clicked_with].flag[dmmo_name].if_null[null]> == my_fancy_item
- narrate "You're clicking with my fancy item!"
When checking if an inventory contains this item use the
InventoryTag.contains_item[item_flagged:<dmmo_name>]
tagExample:
<player.inventory.contains_item[item_flagged:my_fancy_item]>
Returns:
TRUE
/ FALSE