I need help with a progression prevention plugin

  • 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 community!

    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!

Jun 12, 2026
1
0
1
I'm trying to make it so if a player has a diamond chestplate in their inventory it gets rid of it and just gives them 8 diamonds but it isn't working no matter what I'm doing
 
I’ll make a basic script that you can modify to work for your server
 
Last edited:
I think this will work
That code is okay but looping every item in a player's inventory, especially if you have 20+ online players is not going to be great for performance. A better option would utilize inventory click events. That way, the moment a player clicks the item itself, it refunds the required materials without needing to use any loops whatsoever. I put an example below this explanation. Alternatively, to add more items to refund, you can use list variables and functions.

Code:
on inventory click:
    event-inventory is player's inventory
    event-item is diamond chestplate
    remove event-item from player
    give player 8 diamonds
 
That code is okay but looping every item in a player's inventory, especially if you have 20+ online players is not going to be great for performance. A better option would utilize inventory click events. That way, the moment a player clicks the item itself, it refunds the required materials without needing to use any loops whatsoever. I put an example below this explanation. Alternatively, to add more items to refund, you can use list variables and functions.

Code:
on inventory click:
    event-inventory is player's inventory
    event-item is diamond chestplate
    remove event-item from player
    give player 8 diamonds
That’s what I was thinking, but I just wanted to give a quick “simple” answer