coolsquid / React

Scriptable reactions to events
The Unlicense
3 stars 0 forks source link

set_block #7

Closed mobeonsa closed 6 years ago

mobeonsa commented 6 years ago

What is the right syntax of "action=set_block" coordinates? Then i tried x = 1, it works but ~ or ~1 or "~" doesn't work. Log says: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Number:

Full script:

block_place=[
    {
        action=cancel
        conditions {
            block  {
                name="minecraft:anvil"
            }
        }
    }
    {
        action=set_block
        parameters {
            block="minecraft:anvil"
            x=~0
            y=~0
            z=~0
        }
    }
]

PS I'm trying to make anvil falling doesn't break it. PS PS Sorry for bad eng(

coolsquid commented 6 years ago

If the coordinate contains "~", it must be surrounded by quotation marks.

block_place=[ # is this supposed to be "block_break"?
    {
        action=cancel
        conditions {
            block  {
                name="minecraft:anvil"
            }
        }
    }
    {
        action=set_block
        parameters {
            block="minecraft:anvil"
            x="~0"
            y="~0"
            z="~0"
        }
    }
]