mojira.dev
MCPE-173406

itemUseOn not working with empty hand anymore

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.

Comments 2

Thank you for your report!

However, this issue has been temporarily closed as Awaiting Response.

Could you please attach an example addon showcasing the issue?

This ticket will automatically reopen when you reply.

Quick Links:
📓 Issue Guidelines – 💬 Mojang Support – 📓 Project Summary – 📧 Suggestions – 📖 Minecraft Wiki

Cleaning up old tickets: This ticket had been set to 'Awaiting Response', but has not received a response from the reporter (~3 months+) so is being closed as Incomplete. If you feel this is still a valid issue then please comment, or create a new ticket following the Issue Guidelines which includes steps to reproduce the problem.

Quick Links:
📓 Issue Guidelines – 💬 Mojang Support – 📧 Suggestions – 📖 Minecraft Wiki

Maximilian Ewald

(Unassigned)

Unconfirmed

Multiple

Windows 11

Script-API

1.20.12 Hotfix

Retrieved