Mojira Archive
MCM-1717

[BLOCKING] EntityEquippableComponent does not work on beforeEvents in read-only mode

Partner Rank: 2

Partner Team Reporting: Floruit

Verification builds: 1.20.40 (stable), 1.20.50.22 (beta)

Summary:
EntityEquippableComponent does not work on beforeEvents in read-only mode unlike another components.

Impact:
The issue prevents the creator from doing tests for entity equipments through beforeEvents. That is blocking my content that needs to check if the player has a specific amount of arrow items in its inventories, counting all inventory slots and Offhand slot, and then cancel the use operation of my custom bows (which can only be done by beforeEvents). My script works perfectly for the inventory component, but requests for required privileges to test for the equippable component.

Repro Steps:

  1. Open a world with the attached example behavior pack enabled.
  2. Give yourself a arrow /give @s arrow.
  3. Hold the arrow in your main hand and right-click any block in the world.
  4. Observe the content log errors.

Repro Rate: 3/3
 
Observed Results:
The content log will send a message requesting for required privileges to use the EntityEquippableComponent properly.


 
Expected Results:
EntityEquippableComponent should properly work for beforeEvents in read-only mode just like the EntityInventoryComponent does.
 
Screenshots/Videos attached: Yes

Notes:
Tested on '@minecraft/server' version 1.6.0. Below is the example code:

import { world } from '@minecraft/server';

world.beforeEvents.itemUse.subscribe(data => {
  if (data.itemStack?.typeId === 'minecraft:arrow') {
    if (data.source?.getComponent('equippable').getEquipment('Mainhand')?.typeId === 'minecraft:arrow') {
      let readOnly = true;
    }
  }
});

Note that it is not trying to modify anything in the world, just read-only.

Duplicate

Jean Lucas

2023-10-26, 07:08 PM

2023-10-31, 01:03 AM

2023-10-30, 06:04 PM

0

0

Future Release

-