Tom Adriaenssen
- Inferis
- JIRAUSER624744
- Europe/Stockholm
- Yes
- No
Steps to Reproduce:
- create addon featuring GameTest code
- Retrieve an entity
- Find a component that allows access to the armor inventory ("minecraft:armor"?), mainhand ("minecraft:mainhand"?) or offhand ("minecraft:offhand"?)
Observed Results:
No such components exist.Expected Results:
The component existsand are accessible like an actual inventory, much like "minecraft:inventory".Steps to Reproduce:
- create addon featuring GameTest code
- Retrieve an entity
- Find a component that allows access to the armor inventory ("minecraft:armor"?), mainhand ("minecraft:mainhand"?) or offhand ("minecraft:offhand"?)
Observed Results:
No such components exist.Expected Results:
The components exist and are accessible like an actual inventory, much like "minecraft:inventory".
Steps to Reproduce:
- create addon featuring GameTest code
- Retrieve a tool (e.g. pickaxe) with enchantments on it
- Run the code below to retrieve an enchantment
Observed Results:
The code doesn't workExpected Results:
The code does work and it is possible to retrieve an enchantment (or all enchantments).let inventory = player.getComponent("minecraft:inventory") if (inventory && inventory.container) { let item = inventory.container.getItem(player.selectedSlot) let enchantmentsComponent = item.getComponent("minecraft:enchantments") if (enchantmentsComponent != null) { let enchantments = enchantmentsComponent.enchantments if (enchantments != null) { let enchantment = enchantments.getEnchantment(EnchantmentType.mending) // ? } } }EnchantmentType.mending does not exist, and EnchantmentType does not have a constructor. I've tried with "mending" or "minecraft:mending" but that gives the same result.
None of this is properly documented it appears.
The releasenotes also mention`allEnchantments` but that does not exist either.Steps to Reproduce:
- create addon featuring GameTest code
- Retrieve a tool (e.g. pickaxe) with enchantments on it
- Run the code below to retrieve an enchantment
Observed Results:
The code doesn't workExpected Results:
The code does work and it is possible to retrieve an enchantment (or all enchantments).let inventory = player.getComponent("minecraft:inventory") if (inventory && inventory.container) { let item = inventory.container.getItem(player.selectedSlot) let enchantmentsComponent = item.getComponent("minecraft:enchantments") if (enchantmentsComponent != null) { let enchantments = enchantmentsComponent.enchantments if (enchantments != null) { let enchantment = enchantments.getEnchantment(EnchantmentType.mending) // ? } } }EnchantmentType.mending does not exist, and EnchantmentType does not have a constructor. I've tried with "mending" or "minecraft:mending" but that gives the same result.
None of this is properly documented it appears.
The releasenotes also mention allEnchantments but that does not exist either.