Is there a way to do this?

  • 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.

CatsAreit

New Member
Feb 11, 2017
9
0
0
117
Is there a way to make a chest spawn at a certain location with items in it? Thanks!
 
There is two ways to do it the first one is not my skript i just add it the command -> execute console command "/setblock <x> <y> <z> chest" make sure to change the x y z to the location that you want and random item from the list will add to the chest when you type /items
Is there a way to make a chest spawn at a certain location with items in it? Thanks!
code_language.skript:
on load:
    clear {chestitems::*}
    add 5 wood to {chestitems::*}
    add 1 diamond pickaxe to {chestitems::*}
    add wooden sword of sharpness 2 to {chestitems::*}
    add 1 diamond sword to {chestitems::*}
    add 1 diamond helmet of fire protection 1 to {chestitems::*}
    add 10 arrow to {chestitems::*}
    add 1 ender pearl to {chestitems::*}
    add 23 xp bottle to {chestitems::*}
    add 5 golden apple to {chestitems::*}                   
    add 1 iron sword to {chestitems::*}
    add 1 ender pearl to {chestitems::*}
    add 23 xp bottle to {chestitems::*}       
    add 1 golden apple to {chestitems::*}
    add 1 diamond pickaxe to {chestitems::*}
    add 1 iron axe to {chestitems::*}
    add 1 ender pearl to {chestitems::*}
    add 23 xp bottle to {chestitems::*}
    add 5 golden apple to {chestitems::*}
    add 1 wooden sword of sharpness 2 to {chestitems::*}
    add 1 diamond chestplate of fire protection 1 to {chestitems::*}
    add 12 arrow to {chestitems::*}
    add 1 slimeball of knockback 5 to {chestitems::*}
    add 1 ender pearl to {chestitems::*}
    add 23 xp bottle to {chestitems::*}
    add 5 golden apple to {chestitems::*}
    add 12 stained hardened clay to {chestitems::*}
    add 1 diamond sword to {chestitems::*}
    add diamond chestplate of fire protection 4 to {chestitems::*}
    add 1 bow of flame 1 to {chestitems::*}
    add 1 diamond sword to {chestitems::*}
    add 1 golden boots of fire protection 4 to {chestitems::*}
    add 5 golden apple to {chestitems::*}
    add 12 stained hardened clay to {chestitems::*}
    add 1 golden helmet of fire protection 4 to {chestitems::*}
    add 1 lava bucket to {chestitems::*}
    add 8 cooked beef to {chestitems::*}
    add 23 xp bottle to {chestitems::*}
    add 12 stained hardened clay to {chestitems::*}
    add 1 diamond helmet of fire protection to {chestitems::*}
    add 1 golden sword of fire aspect 1 to {chestitems::*}
    add 1 diamond leggings of fire protection 4 to {chestitems::*}
    add 5 golden apple to {chestitems::*}
    add 12 stained hardened clay to {chestitems::*}
    add 1 wooden sword of sharpness 2 to {chestitems::*}
    add 12 wood to {chestitems::*}
    add 10 arrow  to {chestitems::*}
    add 1 ender pearl to {chestitems::*}
    add 23 xp bottle to {chestitems::*}
    add 5 golden apple to {chestitems::*}
    add 12 stained hardened clay to {chestitems::*}
    add 1 diamond helmet of fire protection 1 to {chestitems::*}
    add 1 diamond pickaxe to {chestitems::*}
    add 1 iron axe to {chestitems::*}
    add 8 stone:1 to {chestitems::*}
    add 1 iron axe to {chestitems::*}
    add 1 ender pearl to {chestitems::*}
    add 23 xp bottle to {chestitems::*}
    add 5 golden apple to {chestitems::*}
    add 1 wooden sword of sharpness 2 to {chestitems::*}
    add 1 diamond sword to {chestitems::*}
    add 12 arrow to {chestitems::*}
    add 1 bow to {chestitems::*}
    add 1 wooden sword of sharpness 2 to {chestitems::*}
    add 1 diamond sword of fire aspect 1 to {chestitems::*}
    add 12 arrow to {chestitems::*}
    add 10 arrow to {chestitems::*}
    add 1 diamond boots of fire protection 4 to {chestitems::*}
    add 1 diamond helmet of fire protection 4 to {chestitems::*}
    add 1 stone sword of fire aspect 1 to {chestitems::*}
    add 1 bow of infinity to {chestitems::*}           
    add 1 golden boots of fire protection 4 to {chestitems::*}
    add 1 iron block to {chestitems::*}
    add 1 stick to {chestitems::*}
    add 1 bow of flame 1 to {chestitems::*}
    add 1 arrow to {chestitems::*}
    add 12 arrow to {chestitems::*}
    add 1 diamond sword to {chestitems::*}
    add 1 diamond sword of sharpness 1 to {chestitems::*}
    add 1 leather chestplate of fire protection 4 to {chestitems::*}
    add 8 stone:1 to {chestitems::*}
command /items:
    trigger:
        execute console command "/setblock <x> <y> <z> chest"
        loop all blocks in radius 200 of player:
            if loop-block is a chest:
                loop (random integer between 1 and 30) times:
                    set {_item} to a random element of {chestitems::*}
                    add {_item} to block at loop-value
the second it by command of the normal minecraft
code_language.skript:
command /chest:
    trigger:
         execute console command "/setblock x y z chest 0 replace {
    Items: [
        {
            id: 29,
            Slot: 0,
            Count: 3
        },
        {
            id: 5,
            Damage: 5,
            Slot: 1,
            Count: 1
        },
        {
            id: 276,
            Slot: 2,
            Count: 1
        },
        {
            id: 95,
            Damage: 13,
            Slot: 16,
            Count: 1
        },
        {
            id: 16,
            Slot: 23,
            Count: 1
        }
    ],
    display: {
        Name: "Cool Chest",
        Lore: [
            "This command by HOHOHOHO"
        ]
    }
}"
[doublepost=1491423383,1491423258][/doublepost]here is chest command generator https://minecraftcommand.science/prefilled-chest-generator
 
Positioning:
code_language.skript:
set block to location at X , Y , Z in world "NAME" to Chest
Adding items:
code_language.skript:
on rightclick on chest:
    add 2 Stone to inventory of event-block

EDIT:

If you need to add a lot of items , i suggest you to do that:
code_language.skript:
on rightclick on chest:
    add dirt, stone, iron axe and air to {_items}
    set {_item} to a random item out of {_items}
    add {_item} to inventory of event-block
 
  • Like
Reactions: Aryaz25 and OHOHOHO
Status
Not open for further replies.