mojira.dev
MC-126666

"/execute if block" fails to detect lava/water

trying to detect water or lava relative to the player fails if the block adjacent to the fluid where it would spread to just changed. (green block in picture)
If the block didn't change for the time the fluid would spread "execute if block" will work again.

In this example I use an advancement for mining cobble from a cobble-generator. It uses the inventory_changed trigger with item cobblestone to grant a function as reward that tests if the player is at a cobble-generator.
The according test for the situation in the picture is:

execute anchored feet if block ~1 ~ ~1 minecraft:water if block ~ ~ ~2 minecraft:lava run scoreboard players add @p adv_cobblegen 1
execute anchored feet if block ~1 ~ ~1 minecraft:water if block ~-1 ~ ~1 minecraft:lava run scoreboard players add @p adv_cobblegen 1

(all other orientations behave the same way)

This fails if the player mines cobblestone from the green blocks position. But it succeeds if the function gets called manually or the inventory changes with still containing cobblestone. Booth only if the green block did not change recently.

Attachments

Comments 2

Have you tried flowing_water/flowing_lava?

... If only I knew earlier that flowing liquid is only "flowing" while it checks if it could spread.
It would have saved me half a day debugging and a big headache.

thanks, it is working now

DANG! I didn't want to open this again!

Dobrand

(Unassigned)

Unconfirmed

block-update, execute, lava, testforblock, water

Minecraft 18w09a

Retrieved