Uploaded image for project: 'Minecraft (Bedrock codebase)'
  1. Minecraft (Bedrock codebase)
  2. MCPE-115861

[Addons] Creating a Mob with Inventory but no Slots Prevents Player from accessing Inventory

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • None
    • 1.16.201 Hotfix
    • None
    • Unconfirmed
    • Windows

      Creating a mob with an inventory (e.g. horse) but removing any slots from "minecraft:equippable" (e.g. saddle & horse armor) prevents the player from viewing the mob's inventory, which makes sense. However, after attempting to view the mob's inventory, the player cannot view their own inventory, including accessing chests & other mobs' inventories.

      Steps to Reproduce:
      1. Create addon
      2. Add a mob (i.e. horse, llama)
      3a. Copy horse.json from behavior pack
      4a. Add "minecraft:is_chested": {} to tamed version of mob
      5a. Add into component_groups: "minecraft:inventory": { "inventory_size": 9, "container_type": "horse", "additional_slots_per_strength": 3 } (or replace numbers with your choice)
      6a. Add the following to component_groups:  "minecraft:strength_3": { "minecraft:strength_3": { "minecraft:strength":{ "value": 3 }} (or replace with the 2nd number of choice) I'm unsure if this step is necessary, but I included it because it exists in the llama's code
      7a. Add to event "minecraft:entity_spawned" the following component group: "minecraft:strength_3" (or 2nd number)
      8a. Lastly, remove "minecraft:equippable" from tamed version if present.

      3b. Replace behavior code with below json & change ex:mob to the proper namespace & name used in the rest of the addon.

      Observed Results:
      Mob's inventory fails to appear & player is unable to see their own inventory at any capacity.

      Expected Results:
      A: Equippable slots are not shown, only "chest" slots
      B: No inventory is shown, but player is still able to see their own inventory & interact with chests, other mobs' inventories, etc.

      Workarounds:
      Player: Exit & return to game.
      Developer: Add "dummy" slot like saddle, horse armor, or carpet to access mob's chest. This solution still involves proper implementation of saddle/armor/carpet code just to be able to access mob's inventory. OR remove equippable properties, leaving a bare "minecraft:equippable": {} in the tamed mob's component_group, despite no item being actually equippable by the mob.

        1. effect_of_mob_inventory_addon_bug.png
          505 kB
          Douglas F Correa
        2. example_mob.json
          2 kB
          Douglas F Correa

            DeeFeeCee Douglas F Correa
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: