Config Restrictions

Allow only certain players to interact with the slots; running commands or storing items.

/goop containers config restrictions <container> <slot> <kind> <value>

Players must be a certain level / class, or have certain permission to use. Also define what happens if the player is no longer able to use the slot, but they already had put an item in there.

This slot requires the player to be level 40 or higher to use.

Args Breakdown (What everything does)

<container>

<slot>

    • Slot numbers that you want to edit. Always a positive integer number.

    • Though you normally target containers with the c key...

      • For this command do not use it, just do 0-8,9,17 instead of c0-8,c9,c17

      • You don't actually have the container open now so this c key wouldn't work anyway

<kind>

    • Kind of restriction that you want to set.

      • CLASS Classes the player must be to interact with these slots. Requires MMOItems.

      • LEVEL Level ranges the player must be to use the slots. Requires MMOItems.

      • PERMISSION Required permissions the player must have

      • UNLOCKABLE GooP Unlockables the player must have unlocked.

      • BEHAVIOUR What happens if the player already put items in the slot, but they lose access to it?

<value>

    • Required attributes that the player must have.

      • When choosing kind CLASS:

        • A list of classes that are allowed. Suppose you have classes Rogue, Mage, and Warrior:

          • Rogue,Mage allows a player either Rogue OR Mage to use

          • Rogue&&Mage the player must be Rogue AND Mage at the same time...?

          • Rogue&&Mage,Warrior the player must be Rogue AND Mage... OR just be Warrior.

        • The AND operator && is evaluated before the OR operator, ,.

      • When choosing kind LEVEL:

        • Range of levels the player must have, in the vanilla format (2..4, 10.., etc.)

      • When choosing kind PERMISSION:

        • Same as when choosing CLASS, but with permisson names instead of classes.

      • When choosing kind UNLOCKABLE:

        • Same as when choosing CLASS, but with unlockables' names instead of classes.

      • When choosing kind BEHAVIOUR:

        • LOCK The player won't be able to remove the item, the item will be trapped there.

        • TAKE The player will be able to take the item out; wont be able to put it back in.

        • DROP The item will be forcefully given to the player, or dropped to the ground if their inventory is full.

        • DESTROY The item will be straight up deleted.

Tips

  • Restrictions prevent items from being stored in slots, by the attributes of the player trying to store them.

    • To prevent players from storing items in slots, based on attributes of the item (like being a specific MMOItem Type), see Masks.


  • Restriction Behaviours that forcefully remove items from the slot are not checked continuously:

    • DROP is only checked when the container is opened or closed.

    • DESTROY is only checked when the container is opened, closed, or when MMOItems reloads equipment.


  • If a player does not match the restrictions, the following features are disabled for that slot:

    • Storing items in the slot

    • Clicking to run commands

    • Equipping the item's stat values

      • Even if the item is still there, when using LOCK or TAKE.


  • When it comes to Personal Containers

    • Any players will be prevented from putting items into slots, if they dont meet the restrictions, even if the owner of the container does meet them.

    • Only the owner may take items out if the behaviour is TAKE.

    • Only the owner will receive the items if the behaviour is DROP.


  • When it comes to Physical Containers

    • Any player will be prevented from putting items into slots, if they dont meet the restrictions, even if the 'owner' of it does meet them. There might not even be an owner.

    • Only the owner and admins (according to the protection) can take items from TAKE slots... if there is no owner (no protection), anyone can.

    • Only the owner and admins (according to the protection) can receive items from DROP slots... if there is no owner (no protection), anyone can.


  • If the restriction behaviour is TAKE, the Command On Take will still run when the player removes the item, even though the slot is technically disabled.

Simple Examples:

/goop containers config restrictions BANK 9-17 unlockable BankRow2

The slots of the second row of the 'BANK' can only be used if the player has unlocked 'BankRow2'


/goop containers config restrictions BANK 9 unlockable BankRow2,Bank9

The ninth slot of 'BANK' can be used if the player has unlocked 'BankRow2', or individually, 'Bank9'


/goop containers config restrictions BANK 0-36 behaviour LOCK

If the player suddenly stops having the bank slots unlocked, they won't be able to retrieve their items from it!