Count Gems

Sets target's scoreboard to the amount of gem slots in a player's item.

/goop mmoitems countGems <includeEmpty> <player> <slot> [range] [scoreboard]

Can count those with a gemstone in it (Filled), or the total count (Filled + Empty).

Args Breakdown (What everything does)

<includeEmptySlots>

  • TRUE if you want to also count the number of empty slots in the item. Otherwise, it will only count those filled.


<Player>

  • The players whose inventory will be checked, and score changed.

  • Supports a few vanilla selectors.


<Slot>

  • The slot in the player's inventory that will be checked. To read on slots see Inventory Slots.

  • Examples: mainhand, offhand, chest, feet, any, 0-8, ec*


[range]

  • Number of gem slots that will allow the command to succeed (and thus chain commands).


[objective]

  • The name of the scoreboard objective that will store the results.

Tips

  • This, in conjunction with addGemSlot, can be used to make mythic skills that add Gem Slots to players' items up to a limit.

    • Its actually the intended usage.


  • As of GooP 31.10.2021, you can now use a range as shorthand:

    • This only allows to add up to three gem slots, because it succeeds if the item has "less than or equal to two ..2"

    • /goop mmoitems countGems true %player% mainhand ..2 oS: goop mmoitems addGemSlot Uncolored @s @t

Simple Examples:

/goop mmoitems countGems true gunging mainhand hGems

Will count the number of gems and gem slots in player gunging's held item. Will store the result in his score of the objective hGems.


/goop mmoitems countGems false gunging *,ec* carredGems

Will count the total of how many gems are inserted into items gunging has both in their inventory and in their enderchest.

Example: Gem Slot Adder Station (Containers+MythicMobs)

This will be a station that adds Gem Slots to Items placed on it, at a cost of some materials.

  • Players will put the required materials into it (GooP Containers)

  • It will run a series of commands and checks to consume the materials and add the slot (MythicMobs)

  • Flash in different colors depending on failure or success to add a Gem Slot (GooP Containers)

The video is on how to bring the configs below together. MMOItems, OnApply Masks, and MythicSkills are pre-loaded.

Skip to 6:05 to see it in action.

Mythic Mob Skills (With explanation):

https://pastebin.com/kB0e7rX8


https://pastebin.com/yRM7uytu


MMOItems:

https://pastebin.com/c59VX9PH


Remember to add the GEM_COLOR_CRYSTALS item type, thats what the OnApply mask is targetting:

pluigins/MMOItems/item-types.yml

GEM_COLOR_CRYSTALS: display: QUARTZ name: 'Gem Color Crystal' parent: 'MISCELLANEOUS' unident-item: name: '&f#prefix#Unidentified Shards' lore: - '&7These shards are unidentified. I must' - '&7find a way to identify them!' - '{tier}' - '{tier}&8Item Info:' - '{range}&8- &7Lvl Range: &e#range#' - '{tier}&8- &7Item Tier: #prefix##tier#'