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

[script api]spawnEntity can`t spawn entity when “is_summonable” is set to false

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.21.2 Hotfix, 1.21.60.24 Preview
    • None
    • Community Consensus
    • Multiple

      Description:

      The dimension.spawnentity methods throw error when try to spawn entity with component "is_summonable" set to false.

      Code:
      import { world} from "@minecraft/server";

      export function testfunction(entity,source)

      {     source.dimension.spawnEntity(entity,source.getHeadLocation()) }

      world.afterEvents.itemUse.subscribe((event) =>

      {     if (event.itemStack.typeId == "minecraft:stick")         testfunction("xr:entity_1",event.source,);     if (event.itemStack.typeId == "minecraft:feather")         testfunction("xr:entity_2",event.source,); }

      )
       
      *entity_1 has component "is_summonable" set to true while entity_2 didn`t
      Steps:

      1 Extract the following zip file and put it into the development behavior pack folder within minecraft.Create a world with the BP.

      2 Get a stick and a feather and right click them.It throws the error message "Failed to call function 'spawnEntity'".

      Results:

      entity_1 was spawned successfully but entity_2 didn`t.(use command "/say @e" to check)

      Expected results:

      both the entity spawned successfully

       

        1. bug.png
          1.08 MB
          KR_
        2. example BP.mcpack
          2 kB
          XRAY3036039

            XRAY3036039 XRAY3036039
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              CHK: