Loop all chest in region

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

Status
Not open for further replies.

_ToastDK

Member
Aug 16, 2017
15
0
0
Hello :emoji_slight_smile:

I want to loop all chest in a region to remove illegal items from chests.. How can i loop all chests in a region? :emoji_slight_smile:

I hope someone can help me :emoji_slight_smile:
 
Please use the help request format --> https://forums.skunity.com/wiki/help-request-layout/
There is a loop all blocks expression in a region, but It may be a bit easier depending on what you want to accomplish to have it store the chest location in a list variable when they are placed. then you can just loop the list of chests for that region.
 
Hello :emoji_slight_smile: Thanks.

I have found a way to do it..

Can you help to find a better way to add to chest to {chest::*}? :emoji_slight_smile:

Sry for my bad english..


command /ransag:
trigger:
remove 32 of stone from {chests::*}'s inventory

on place of chest or trapped chest:
add block at target block to {chests::*}
message "Block sat - %{chests::*}%"

on break of chest or trapped chest:
remove air from {chests::*}
remove chest from {chests::*}
message "Block sat - %{chests::*}%"
 
Hello :emoji_slight_smile: Thanks.

I have found a way to do it..

Can you help to find a better way to add to chest to {chest::*}? :emoji_slight_smile:

Sry for my bad english..


command /ransag:
trigger:
remove 32 of stone from {chests::*}'s inventory

on place of chest or trapped chest:
add block at target block to {chests::*}
message "Block sat - %{chests::*}%"

on break of chest or trapped chest:
remove air from {chests::*}
remove chest from {chests::*}
message "Block sat - %{chests::*}%"
You could do it this way, where it add's the location. elsewise if you use the target or event block it's just adding the item name "chest" to the list.
code_language.skript:
on place of chest or trapped chest:
    add "%location of event-block%" to {chest::*}
    send "%location of event-block%"
 
Okay :emoji_slight_smile: i will try this thanks :emoji_slight_smile:
[doublepost=1502908492,1502908206][/doublepost]Its not working. Now it saying the locations of the chest before it says just chest..
[doublepost=1502908710][/doublepost]I think it working now :emoji_slight_smile: Thanks for the help.

<code>
command /ransag:
trigger:
remove 32 of stone from {chests::*}'s inventory

on place of chest or trapped chest:
add event-block to {chests::*}
message "Block sat - %{chests::*}%"

on break of chest or trapped chest:
remove event-block from {chests::*}
message "Block fjernet - %{chests::*}%"
</code>
 
Status
Not open for further replies.