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

itemUseOn not working with empty hand anymore

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • None
    • 1.20.12 Hotfix
    • Unconfirmed
    • Multiple

      The event itemUseOn doesn't get called with empty hand anymore.

      This event was usefull for preventing players from interacting with chest, buttons, etc.

      But now players just need to empty their hands to interact with the block.

       

      import {world} from "@minecraft/server";
      
      world.beforeEvents.itemUseOn.subscribe((event)=> {
         if(event.block.typeId=="minecraft:chest"){
            event.source.sendMessage("Hand is not empty");
            event.cancel=true;
         }
      })

      Tested with Windows 11 on server software for linux.

       

       

      Steps to reproduce:

      1. Run a world with this script.
      2. Place a chest
      3. Interact with the chest with a full hand
      4. Interact with the chest with an empty hand

      New events like handSlotChange, itemDrop or blockInteract could also solve the issue.

            THANAT0S Maximilian Ewald
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: