Uploaded image for project: 'Minecraft (Bedrock codebase)'
  1. Minecraft (Bedrock codebase)
  2. MCPE-183098

Cancelling water placement doesn't work properly (Script API)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.21.0
    • None
    • Community Consensus
    • Multiple

      Hey,
      I hope this is the right place to report this, but while experimenting with the Script API i found a problem.
      When trying to cancel the placement of water using scripting (world.beforeEvents.itemUseOn), it works perfectly fine, unless it is placed on a block that can be waterlogged, there, it will just normally place the water. I've attached a world with a script that allows to test the issue, as well as a video showing the issue
      **

      How to Reproduce:

      1. Create a world with a behavior pack and add a script that includes the following code (or use the attached world file):
      world.beforeEvents.itemUseOn.subscribe((event) => {  
      if (event.itemStack.typeId === "minecraft:water_bucket") { 
      event.cancel = true; 
      } 
      });  
      1. Join the world and try placing water, you will see the expected result
      2. Try placing water on a waterloggable block (fence, slab, etc.)

      Observed Result:
      The waterloggable block will be waterlogged, even though the item use was cancelled.
      Expected Result:
      The waterloggable block should not be waterlogged.

            powh powh
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              CHK: