1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Ender chest item limit

Discussion in 'Skript' started by Jairo Echevarria, Jun 12, 2021.

Thread Status:
Not open for further replies.
  1. Jairo Echevarria

    Jairo Echevarria New Member

    Joined:
    Mar 28, 2021
    Messages:
    7
    Likes Received:
    0
    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
     
  2. Minecoll_YT

    Supporter Forums Helper

    Joined:
    Dec 2, 2018
    Messages:
    650
    Likes Received:
    40
    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 (Text):
    1. # inventory click stuff...
    2. if amount of shulker box in player's current inventory is more than 0:
    3.   cancel event
     
    Jairo Echevarria likes this.
  3. Jairo Echevarria

    Jairo Echevarria New Member

    Joined:
    Mar 28, 2021
    Messages:
    7
    Likes Received:
    0
    Code (Text):
    1. on inventory click:
    2.   if inventory type of player's current inventory is ender chest:
    3.     if amount of shulker box in player's current inventory is more than 1:
    4.       cancel event
    5.       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:')
    --- Double Post Merged, Jun 15, 2021, Original Post Date: Jun 14, 2021 ---


    I was able to fix the issue by making it:


    Code (Text):
    1. on inventory click:
    2.   if name of player's current inventory is "Ender Chest":
    3.     if amount of shulker box in player's current inventory is more than 0:
    4.       cancel event
    5.       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
     
  4. Minecoll_YT

    Supporter Forums Helper

    Joined:
    Dec 2, 2018
    Messages:
    650
    Likes Received:
    40
    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:
     
Thread Status:
Not open for further replies.

Share This Page

Loading...