Ender chest item limit

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Jairo Echevarria

New Member
Mar 28, 2021
7
0
1
18
Hello!! I was wondering if someone could help me with a short skript!!

Objective:
Allow a max of 1 shulker box of any color in the players ender chest, if they try to add more, it cancels the event

For MC Version: 1.16.5
Skript Version: Latest of current date 6/12/2021

It would be amazing if someone could provide me with the skript!

Bonus!:
I also want to remove the ability from players to be able to add tnt in shulker boxes
upload_2021-6-12_16-16-17.png

^^ This is what I have for it, but I don't know if it's correct or not
 
Please post your code in the code format and don't use screenshots.

For you already existing skript try changing if item is tnt to if event-item is tnt
And for the shulker box limit you have to use loops or amount of in the inventory click event. I'm not very good with GUIs but it should be something like:
Code:
# inventory click stuff...
if amount of shulker box in player's current inventory is more than 0:
  cancel event
 
  • Like
Reactions: Jairo Echevarria
Code:
on inventory click:
  if inventory type of player's current inventory is ender chest:
    if amount of shulker box in player's current inventory is more than 1:
      cancel event
      send "Sorry, but only a max of 1 Shulker Box per echest!!"

I made this but it gives me an error:
Can't compare 'inventory type of player's current inventory' with an item type (admin.sk, line 70: if inventory type of player's current inventory is ender chest:')
[doublepost=1623711706,1623710564][/doublepost]
Code:
on inventory click:
  if inventory type of player's current inventory is ender chest:
    if amount of shulker box in player's current inventory is more than 1:
      cancel event
      send "Sorry, but only a max of 1 Shulker Box per echest!!"

I made this but it gives me an error:
Can't compare 'inventory type of player's current inventory' with an item type (admin.sk, line 70: if inventory type of player's current inventory is ender chest:')



I was able to fix the issue by making it:


Code:
on inventory click:
  if name of player's current inventory is "Ender Chest":
    if amount of shulker box in player's current inventory is more than 0:
      cancel event
      send "Sorry, but only a max of 1 Shulker Box per echest!!"

However am getting an issue where it won't let me remove the shulker box out of the ender chest. The Max Value does appear to be working properly however it won't let the player remove it from there ender chest to their inventory
 
Code:
on inventory click:
  if name of player's current inventory is "Ender Chest":
    if amount of shulker box in player's current inventory is more than 0:
      cancel event
      send "Sorry, but only a max of 1 Shulker Box per echest!!"

However am getting an issue where it won't let me remove the shulker box out of the ender chest. The Max Value does appear to be working properly however it won't let the player remove it from there ender chest to their inventory

check in which inventory the clicked item, I can't remember exactly, but I think it was smth like if event-inventory is shulker box:
 
Status
Not open for further replies.