Custom MMOItem stat that prevents using the item if the player doesn't meet this number.
Will only count those of items a player has equipped.
You may add as many as you want by adding items to the list in your GooP config.yml, more information in the section below.
MiscRstStatAmount:
- '<placeholders> <range>'
- [...]
Changes require server reboot for changes.
So there is that list in the GooP config.yml
MiscRstStatAmount:
- '<placeholders> <range>'
- [...]
The number of items in the list will be the number of Misc Restriction stats in your server.
To remove them completely (A list of size ZERO), just use MiscRstStatAmount: [] which is YML syntax for an empty list.
The last thing you write has to be the number range that must be met.
The range is in the form of vanilla minecraft ( -32.03..-4.5 means -32.03 through -4.5 ), inclusive.
When putting stats in MMOItems, you have to give the stat a value. You can't make a sword with +0 Attack Damage, and you can't make an item with +0 Extra Restriction Stat A. You can, however, give it +0.0001 Extra Restriction Stat A if you wish.
First of all, this value is per-item. It doesn't add up with the player's equipment.
When equipping the item, the value inside it will be read, and the item cannot be equipped if the final value is outside the range.
Suppose you have an item with +20 Extra Restriction Stat A, and this in your config:
MiscRstStatAmount:
- '15..'
It turns out, 20 is "greater or equal to 15." Then, the item can be equipped. However, an item with +10 Extra Restriction Stat A cannot be.
The point is to disable the item when a player doesn't meet the requirement, and giving a value to the stat in the item does not really work all the time. Suppose you wanted "Required Speed," it is the player who must obtain other equipment and attain this speed through other means before equipping the item. The value of "Required Speed" in the item never really changes.
So here you will list the PAPI placeholders that participate in this operation. Separate them with spaces.
MiscRstStatAmount:
- '%mmocore_mana% %player_y% 100..'
The value of these placeholders will be added, and then compared to the range you specified.
Then, an item which has +7 Extra Restriction Stat A will follow the next operation:
Player has 300 mana, and is on a mountain at Y=120. Then, 300 + 110 + 7 = 417, which is "greater or equal to 100"
The item can be equipped
The player has 140 mana remaining, in the deep dark at Y=-60. Oh no! 140 - 60 + 7 = 87 which is not "greater or equal to 100"
The item cannot be equipped
Give items +0.0001 Extra Restriction Stat A to use only placeholders in the operation.
MMOItems will remove any +0 Numeric Stat because it thinks they are "redundant," which means the restriction on the item will be removed.
If you want the stat to add with all the other equipped items of the player (like normal numeric stats), use its own PAPI placeolder.
This works because the math operation occurs before the item is equipped
For example, %goop_mmostat_GOOP_MISC_RST_A% for the Extra Restriction Stat A.
Similar to numeric placeholders, you can retrieve the value:
<goop.castermmostat.GOOP_MISC_RST_A>
<goop.castermmostat.GOOP_MISC_RST_B>
<goop.castermmostat.GOOP_MISC_RST_C>
Will add up its value in all the stuff a player has equipped (and can use).
May use triggermmostat to target the trigger though.
For more detailed information see the MMOStat Placeholders page.
Add to plugins/MMOItems/language/stats.yml:
goop-misc-rst-a: '&8■ &7Whatever you want: &f#'
goop-misc-rst-b: '&e➸ &7Whatever you want: &f#'
goop-misc-rst-c: '&a&l҉ &7Whatever you want: &f#'
Add to plugins/MMOItems/language/lore-format.yml:
#goop-misc-rst-a#
#goop-misc-rst-b#
#goop-misc-rst-c#
You can equip them individually, but not all of them at the same time!
Uses only one Extra Restriction stat (GooP)
Define your Misc Stat like this:
MiscRstStatAmount:
- '%goop_mmostat_GOOP_MISC_RST_A% ..300'
Essentially, if the total exceeds 300, items cannot be equipped anymore.
Then, make a bunch of items with it. For this example, I made a set of armor with each piece +100.
The total will be 400, which is not "less than or equal to 300" as defined in the range ..300
The four pieces cannot be equipped at the same time normally.
Equipping the first three pieces is fine, but you cannot equip the fourth one.
+300 from %goop_mmostat_GOOP_MISC_RST_A%
+100 from the item itself having +100/300
=400 which is greater than 300, preventing you from equipping the item.
For MMOItems language/stats.yml
goop-misc-rst-a: '<#00ff00>☢ <#9f9f9f>Radioactivity: <#fefefe><plus>{value}/300'