# @ ██ [ To use within scripts: ] ██: # | ██ [ Tag usage: ]> ] ██ # @ ██ [ Example: ] ██ # | ██ [ Returns: ItemTag of the saved item. ] ██ # @ ██ [ When comparing it to other items, use the item's flag name `dmmo_name` ] ██: # @ ██ [ Example 1: ] ██ # - ██ [ - define my_held_item ] ██ # - ██ [ - if <[my_held_item].flag[dmmo_name].if_null[null]> == my_fancy_item: ] ██ # - ██ [ - narrate "You're holding my fancy item! ] ██ # @ ██ [ Example 2: ] ██: # - ██ [ on player clicks block: ] ██ # - ██ [ - define item_clicked_with ] ██ # - ██ [ - 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:] tag ] ██ # - ██ [ Example: ] ██ # | ██ [ Returns: TRUE / FALSE ] ██ dmmo_item_command: type: command name: dmmo description: Saves a mmo item to a flag to be used with scripts usage: /dmmo [[name] (remove)] / [list] permission: denizen.dmmo tab completion: 1: ]> 2: remove script: - choose : - case 1: - define item_name - if <[item_name]> == list: - if !: - narrate "<&[error]>There are currently no dmmo items saved." - stop - define items - define count <[items].size> - narrate "<&b><[count]> total dmmo items<&co><&a><[items].keys.separated_by[]>" - stop - if ]>: - narrate "<&[error]>There is already an item saved under the name <[item_name]>" - stop - if matches air: - narrate "<&[error]>You must be holding an item to name" - stop - define item ]> - flag server behr.denizen.dmmo_items.<[item_name]>:<[item]> - narrate "<&a><[item]> saved as dmmo item successfully" - case 2: - if != remove: - narrate "<&[error]>Invalid usage - <&[emphasis]>/dmmo [name] (remove)" - stop - define item_name - if !]>: - narrate "<&[error]>There is no item saved under the name <[item_name]>" - stop - flag server behr.denizen.dmmo_items.<[item_name]>:! - narrate "<&a><[item]> dmmo item removed successfully" - default: - narrate "<&[error]>Invalid usage - <&[emphasis]>/dmmo [name] (remove)"