[SOLVED] [Skript] LOOP-BLOCK LOCATION DOES NOT WORK

Discussion in 'Spigot Discussion' started by WaysFXasd, Jul 10, 2021.

  1. Why this doesn't work? I wasted more than 3 hours and this fckng code still not works!!!!!
    Code (Java):
         
    every 5 tick:
        loop all blocks:
            if {miningfarms::*} contains loop-block:
                if loop-block is not iron block:
                    set {_ev.block} to loop-block
                    clear {videocard.%loop-block's position%}
                    set {btcmined.%loop-block'
    s position%} to 0
                    set {etcmined.%loop-block's position%} to 0
                    set {dashmined.%loop-block'
    s position%} to 0
                    set {lcmined.%loop-block's position%} to 0
                    set {miningspeed.%loop-block'
    s position%} to 0
                    clear {colder.%loop-block's position%}      
                    remove {_ev.block} from {miningfarms::*}
                    loop all players in radius 4 around loop-block'
    s location:
                        if loop-player.getOpenInventory().getTitle() is "&8Майнинг ферма":
                            close loop-player's inventory
     
  2. what are you trying to do?
     
  3. auto-deleting phantom blocks which have variable
     
  4. You can't loop all blocks. I'm pretty sure Skript won't let you because it will crash.
     
    • Agree Agree x 1
  5. Okay, how i can fix my code?
     
  6. You could just loop through that variable {miningfarms::*}
     
    • Agree Agree x 1
  7. I dk how do this, help me xD
    Code (Java):

    every 5 tick:
        loop {miningfarms::*}:
            if {miningfarms::*} contains loop-block:
                if loop-block is not iron block:
                    set {_ev.block} to loop-block
                    clear {videocard.%loop-block's position%}
                    set {btcmined.%loop-block'
    s position%} to 0
                    set {etcmined.%loop-block's position%} to 0
                    set {dashmined.%loop-block'
    s position%} to 0
                    set {lcmined.%loop-block's position%} to 0
                    set {miningspeed.%loop-block'
    s position%} to 0
                    clear {colder.%loop-block's position%}    
                    remove {_ev.block} from {miningfarms::*}
                    loop all players in radius 4 around loop-block'
    s location:
                        if loop-player.getOpenInventory().getTitle() is "&8Майнинг ферма":
                            close loop-player's inventory
     
  8. Oh, solved.

    Code (Java):
         
    every 10 tick:
        loop {miningfarms::*}:
            if loop-value is not iron block:
                set {_todel} to block at loop-value
                set {_ev.block} to location at loop-value
                clear {videocard.%{_todel}%}
                set {btcmined.%{_todel}%} to 0
                set {etcmined.%{_todel}%} to 0
                set {dashmined.%{_todel}%} to 0
                set {lcmined.%{_todel}%} to 0
                set {miningspeed.%{_todel}%} to 0
                clear {colder.%{_todel}%}      
                remove {_ev.block} from {miningfarms::*}
                loop all players in radius 4 around loop-value:
                    if loop-player.getOpenInventory().getTitle() is "&8Майнинг ферма":
                        close loop-player's inventory