Solved Detect which blocks were cobwebs to delete them.

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

SrShiroh

New Member
Aug 28, 2023
5
0
1
21
Hi, I got stuck making this script as I couldn't find a way to change "set {_location::*} to all blocks in radius 3 around player" to only detect cobwebs, can someone help me with that? Sorry for the bad English because I speak Spanish

Code here:
command /cobweb:
    trigger:
        if player is in region "region1":
            set {_location::*} to all blocks in radius 3 around player
                loop {_location::*}:
                    if loop-value is cobweb:
                        set block at loop-value to air
                wait 30 seconds
                loop {_location::*}:
                    set block at loop-value to cobweb
        else:
            set {_location::*} to all blocks in radius 3 around player
                loop {_location::*}:
                    if loop-value is cobweb:
                        set block at loop-value to air
 
Instead of loop {location::*}:, try loop all blocks:. It's just to make things easier. :emoji_thumbsup: For example:

Code:
set {_location::*} to all blocks in radius 3 around player
                loop all blocks:
                    if {_location::*} contains loop-block:
                        if loop-block is cobweb:
                         set loop-block to air
                         wait 30 seconds
                         set loop-block to cobweb
 
Instead of loop {location::*}:, try loop all blocks:. It's just to make things easier. :emoji_thumbsup: For example:

Code:
set {_location::*} to all blocks in radius 3 around player
                loop all blocks:
                    if {_location::*} contains loop-block:
                        if loop-block is cobweb:
                         set loop-block to air
                         wait 30 seconds
                         set loop-block to cobweb
I Fixed your broken format! :emoji_thumbsup:

code_language.skript:
set {_location::*} to all blocks in radius 3 around player
loop all blocks:
    if {_location::*} contains loop-block:
        if loop-block is cobweb:
            set loop-block to air
            wait 30 seconds
            set loop-block to cobweb
 
  • Like
Reactions: Doodle
I Fixed your broken format! :emoji_thumbsup:

code_language.skript:
set {_location::*} to all blocks in radius 3 around player
loop all blocks:
    if {_location::*} contains loop-block:
        if loop-block is cobweb:
            set loop-block to air
            wait 30 seconds
            set loop-block to cobweb
Thanks!