Trying to set a block to a specific location, but it's just not working

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

PlaywithK

Member
Mar 16, 2024
2
0
1
I try to make a OneBlock like Game in the nether, where you mine one specific block and it's replacing itself over and over.
I don't get any errors but it just won't work. Did I do something wrong?
Addons:
-Skellett
-SKBee

Code:
Code:
on load:
    set {_blocklist::*} to netherrack and nether_quartz_ore and nether_gold_ore and nether_wart_block and ancient_debris and soul_sand and soul_soil
    set {_oneblock} to a random element out of {_blocklist::*}
    set block at location 0, 64, 0 in world "world_nether" to {_oneblock}
    broadcast "Block in list is %{_oneblock}%"

on mine:
    if event-block is {_oneblock}:
        if block at location 0.5, 64.5, 0.5 in world "world_nether" is air:
            broadcast "SUCCESFULLY LOCATED"
            set {_oneblock} to a random element out of {_blocklist::*}
            set block at location 0.5, 64.5, 0.5 in world "world_nether" to {_oneblock}

Thanks for every answer <3
 
Hello, try this:

Code:
on load:
    clear {blocklist::*}
    add netherrack and nether_quartz_ore and nether_gold_ore and nether_wart_block and ancient_debris and soul_sand and soul_soil to {blocklist::*}
    set {oneblock} to a random element out of {blocklist::*}
    set block at location 0, 64, 0 in world "world_nether" to {oneblock}
    broadcast "Block in list is %{oneblock}%"
    set {loc} to location(0.5, 64.5, 0.5, world "lobby")

on break:
    if event-block is {oneblock}:
        if event-location = {loc}:
            broadcast "SUCCESFULLY LOCATED"
            set {oneblock} to random element out of {blocklist::*}
            wait 1 tick
            set block at location at {loc} to {oneblock}
 
  • Like
Reactions: PlaywithK
Hello, try this:

Code:
on load:
    clear {blocklist::*}
    add netherrack and nether_quartz_ore and nether_gold_ore and nether_wart_block and ancient_debris and soul_sand and soul_soil to {blocklist::*}
    set {oneblock} to a random element out of {blocklist::*}
    set block at location 0, 64, 0 in world "world_nether" to {oneblock}
    broadcast "Block in list is %{oneblock}%"
    set {loc} to location(0.5, 64.5, 0.5, world "lobby")

on break:
    if event-block is {oneblock}:
        if event-location = {loc}:
            broadcast "SUCCESFULLY LOCATED"
            set {oneblock} to random element out of {blocklist::*}
            wait 1 tick
            set block at location at {loc} to {oneblock}
Hey it worked, thanks a lot!