Skip to content
This repository was archived by the owner on Jan 18, 2021. It is now read-only.
This repository was archived by the owner on Jan 18, 2021. It is now read-only.

Random crash when spawning mobs #153

@tomrhollis

Description

@tomrhollis

Environment: Windows Server 2019
Official EZ release based on 1.16.20.03

The crash (screenshot below) has been happening rarely and randomly for a few versions now. It only seems to happen in my spawn area, where I have a script running which removes hostile mobs from existence as soon as they spawn. I'm guessing this is relevant based on the crash dump including something about spawning.

This is the crash message:
image

And the part of the script that might be triggering the crash, if it's relevant:

const spawnArea = {xnw: -318, znw: -286, xse: -124, zse: -67, ylo: 63, yhi: 255}; 
const hitList = ["minecraft:creeper", "minecraft:drowned", "minecraft:evocation_illager", "minecraft:husk",
			   "minecraft:phantom", "minecraft:pillager", "minecraft:ravager", "minecraft:silverfish",
			   "minecraft:slime", "minecraft:stray", "minecraft:vex", "minecraft:vindictor", "minecraft:witch", 
			   "minecraft:zombie", "minecraft:zombie_villager", "minecraft:cave_spider", "minecraft:spider", "minecraft:zombie_villager_v2"];

system.listenForEvent("minecraft:entity_created", (eventData) => applyMonsterRules(eventData.data.entity));

function applyMonsterRules(entity) {
	//if the new mob is a monster on the list and is inside the spawn area, remove it from existence
	let loc = (system.getComponent(entity, "minecraft:position")).data;
	
	if(hitList.includes(entity.__identifier__) && loc.x > spawnArea.xnw && loc.y > spawnArea.ylo && loc.z > spawnArea.znw &&
			loc.x < spawnArea.xse && loc.y < spawnArea.yhi && loc.z < spawnArea.zse) {

		system.destroyEntity(entity);
		return;
	}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions