mojira.dev
MCPE-241215

The "minecraft:interact" option, which shouldn't consume items, continues to consume items.

Logically, if the "use_item" of "minecraft:interact" is set to False, it shouldn't consume the item used to perform the interaction on the Mobs. In the game, holding +1 unit of that item works perfectly, however, holding either 1 unit of an item that can stack by +1 unit (16 units, 64 units (1 pack), etc.), or 1 item that stacks by 1 (swords, pickaxes, spyglass, etc.), the item is still consumed. Obviously, it's not because of the "use_item" itself, but because of the "transform_to_item" that performs the "/give" that consumes the item (that is, it's as if I were using "/replaceitem" instead of "/give", which shouldn't be the case), but even so, it shouldn't consume if "use_item" is set to False. The images sent are of a Mob I created that is super simple. The only function of my Mob is to perform the interactions mentioned, accepting default apples (representing items that stack by +1 unit) and/or wooden swords (representing items that always stack by 1 unit). Each image shows how all of this is executed, where the image where I hold +1 default apple in the same slot is working correctly, but the others do not show that they work correctly.
Oh, one observation: although I defined a version close to the one I'm using at the time I reported this bug, apparently this bug has been around "forever," and since I'm creating an AddOns that heavily interacts with "minecraft:interact," this ends up hindering me, where items that I obtain in single units per map (in survival mode and without cheats) disappear after I interact, even though I correctly defined that, even if it's only one unit, it should only give me another item without the item that allowed me to perform the interaction disappearing.
The most plausible solution is simply to not have any interaction using "transform_to_item" remove/replace/consume the item that was previously in your hand (except if your hand is empty), and leave that exclusive to "use_item". If no one sets whether "use_item" + "transform_to_item" should consume the item in your hand, leave the default value of "use_item" as the default value of "transform_to_item" (e.g., if, without you defining it, "use_item" is always set to False, then the item you receive via "transform_to_item" should occupy an empty slot, and if the player's inventory is full, it should drop from the player, as usual, just like other similar interactions (e.g., performing a /give on yourself in survival mode with a full inventory)).

Attachments

Comments 1

Thank you for helping us improve Minecraft! We saved your files:

[media][media][media][media][media][media][media]

JesseFC

(Unassigned)

Unconfirmed

Multiple

Android - Moto G53 5G

26.33 Hotfix

Retrieved