Procedure: is [block] unbreakable

Published by DKMK100 on
Issue description

The request is simple. Add a procedure for is [block] unbreakable (I mean test for the unbreakable property, there's a checkbox when you're creating a block).

This would mostly be used for:

 

if( not (is (get block at (targetx) (targety) (targetz) unbreakable))){

Destroy block at (targetx) (targety) (targetz) drop at (x) (y+1) (z)

}

Issue comments

that could be kind of neat. you could make a drill that checks for bedrock under itand stops mining, for example.

I Made block for that it is called "Get Hardness of a block" and its in "Block Tab" since 2020.3 update,
to achieve your effect simply make it like this

If Get hardness of a block at X/Y/Z = "Number Value" or -1 "-1 stands for unbreakable"

If Get hardness of a block at X/Y/Z = "Number Value" or -1 "-1 stands for unbreakable"

Indeed, I forgot about that one :D

Unbreakable is now not a standalone parameter, but the hardness of -1. Thanks Hidan :)