Setting block resistance for blocks?

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

msconfig32

Member
Nov 10, 2018
33
0
6
20
Hello, I would like to know if there was any possible way to have a block have more resistance?
Such as...
https://minecraft.gamepedia.com/Explosion
^ The dragon egg has a block resistance of 45, whereas the netherrack has a resistance of 2, any way to up the resistance to more than 2 for netherrack using skript?
 
You can't actually change the block resistance because that's hard coded into the game, but I'm assuming something like this might be beneficial to you

code_language.skript:
options:
    netherrackHealth: 1
    blastRadius: 6
on explode:
    loop exploded blocks:
        if loop-block is netherrack:
            if "%{blocks.health::%loop-block's location%}%" is "<none>": #Hey is there a better syntax for null values?
                set {blocks.health::%loop-block's location%} to {@netherrackHealth}
                wait 1 tick
                set block at loop-block's location to netherrack
            else if {blocks.health::%loop-block's location%} is more than 0:
                remove 1 from {blocks.health::%loop-block's location%}
                wait 1 tick
                set block at loop-block's location to netherrack
            else if {blocks.health::%loop-block's location%} is 0:
                drop 1 netherrack at loop-block's location
on break:
    delete {blocks.health::%event-location%}
on place:
    delete {blocks.health::%event-location%}

code_language.skript:
on explode:
    wait 1 tick
    loop exploded blocks:
        if loop-block is netherrack:
            chance of 95%:
                set block at location of loop-block to netherrack

Hope this is helpful to you!

The second code isn't working and I'm not entirely sure why. Additionally you would need to find a way to cancel the drops for just the netherrack with the second one.
 
Status
Not open for further replies.