[BDS-18672] [Scripting] EntityEquippableComponent and its methods: setEquipment, getEquipmentSlot and getEquipment are broken Created: 25/Aug/23 Updated: 14/May/24 Resolved: 14/May/24 |
|
| Status: | Resolved |
| Project: | Bedrock Dedicated Server |
| Affects Version/s: | 1.20.15 Hotfix |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | mrpatches123 | Assignee: | Unassigned |
| Resolution: | Incomplete | Votes: | 0 |
| Labels: | None | ||
| Confirmation Status: | Unconfirmed |
| Description |
|
@minecraft/server 1.6.0-beta import { EntityEquippableComponent, EquipmentSlot, system, world } from '@minecraft/server'; system.runInterval(() => { world.getAllPlayers().forEach(player => { /** * @type {EntityEquippableComponent} */ const equippable = player.getComponent('minecraft:equippable'); const slot = equippable.getEquipmentSlot(EquipmentSlot.Offhand); console.warn(slot?.typeId ?? 'null'); }); }); Expected Results: Observed Results: //line 34 const slot = equippable.getEquipmentSlot(EquipmentSlot.Offhand); also entity.getComponent("equippable"); might not work on entities. import { EntityEquippableComponent, EquipmentSlot, system, world } from '@minecraft/server'; world.getDimension(MinecraftDimensionTypes.overworld).getEntities().forEach(entity => { if (entity.typeId !== 'minecraft:skeleton') return; console.warn(entity.typeId); /** * @type {EntityEquippableComponent} */ const equippable = entity.getComponent('minecraft:equippable'); const slot = equippable.getEquipmentSlot(EquipmentSlot.Mainhand); console.warn(slot?.typeId ?? 'null'); }); }); For a skeleton: Observed Results: //line 42 const equippable = entity.getComponent('minecraft:equippable'); |
| Comments |
| Comment by [MCQA] Kinga Izdebska [ 14/May/24 ] |
|
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: |
| Comment by 1l6mnj [ 25/Oct/23 ] |
|
This also happens in 1.20.31, on local worlds. But this time you can get the player's armor, not entities such as zombies |
| Comment by Maciej Piornik [ 30/Aug/23 ] |
|
Hi This occur only on Bedrock Dedicated Server or it can be reproduced on local worlds/Realms? This ticket will automatically reopen when you reply. |
| Comment by mrpatches123 [ 25/Aug/23 ] |
|
Could this get swapped to bedrock edition instead of bds some how didn’t see it. Think something messed up as when I first copied it, it was |