How to edit chest loot

  • 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 our Wiki for downloads and any other information about Skript!

Status
Not open for further replies.

Dems26

Member
Oct 17, 2020
3
0
1
22
The moon
Hi so I am making a server and I need to have some custom heads spawn in chests found in dungeons, nether fortresses, and desert temples, and more how do I do that?
 
This should work, but im not sure how optimal it is.

Code:
on click on chest:
    if {chests::*} contains event-block:
        stop
    else:
        add event-block to {chests::*}
        clear event-block's inventory
        #chest loot
        add 1 player skull to event-block's inventory
        set slot 5 of event-block's inventory to 1 stone
        set slot 12 of event-block's inventory to 1 tnt
        set slot 19 of event-block's inventory to 1 plank
        
on block place:
    if event-block is chest:
        add event-block to {chests::*}
 
Im not sure why is dosent.

I tested it on:

Skript 2.4.1
no addons
and paper 1.15.2

and it works for me.
 
Status
Not open for further replies.