-
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