Areas (Forge)

Areas (Forge)

890k Downloads

[Bug Report] Entity Removal Issue with Collective and Moonrise Integration

gjeempe opened this issue ยท 0 comments

commented

Minecraft version: 1.21.1

Modloader: Fabric
Fabric loader version: 0.16.5
Environment: Multiplayer
First mod name: Collective
First mod version: 7.84
Second mod name: Moonrise
Second mod version: 0.1.0-beta.4

Description

While running Collective 7.84 alongside Moonrise 0.1.0-beta.4 on a Fabric 1.21.1 multiplayer server, I encountered repeated warnings in the server logs about entities being prevented from removal during chunk status updates. The issue stems from the CollectiveEvents.onEntityJoinLevel method in Collective.

The warnings, as shown in the logs, consistently indicate that entities (like Skeletons and Zombies) are being prevented from removal, leading to significant server performance degradation. The issue appears during high entity spawn rates or chunk updates, causing excessive log warnings and potential memory leaks.

The Moonrise mod team responded to this issue, suggesting that removing entities during tracker updates (handled by Moonrise's chunk system) is inherently unsafe in Vanilla, potentially leading to memory leaks when entities are improperly added to the ticking list. Moonrise proactively guards against these issues, and the problem seems to arise from how Collective manages entity removal during world updates. Their full response can be seen here.

Crash report

No crash report is available, but the following warnings frequently appear in the server logs:

[Server thread/WARN]: Entity class_1613['Skeleton'/393, l='ServerLevel[L4V4 W0RLD]', x=60.50, y=30.00, z=145.50] is currently prevented from being removed from the world since it is processing section status updates
java.lang.Throwable: null
	at com.natamus.collective_common_fabric.events.CollectiveEvents.onEntityJoinLevel(CollectiveEvents.java:216)
	at com.natamus.collective.CollectiveFabric.lambda$onInitialize$4(CollectiveFabric.java:47)
	at net.fabricmc.fabric.api.event.lifecycle.v1.ServerEntityEvents.lambda$static$0(ServerEntityEvents.java:39)
	at ca.spottedleaf.moonrise.patches.chunk_system.level.entity.EntityLookup.addNewEntity(EntityLookup.java:393)
	at net.minecraft.server.world.ServerWorld.addEntity(ServerWorld.java:935)

Steps to Reproduce:

Install Collective 7.84 and Moonrise 0.1.0-beta.4 in a Fabric 1.21.1 multiplayer server.
Allow mob spawns to occur, particularly in areas with heavy chunk activity.
Monitor the server logs for entity removal warnings and performance degradation.
Expected Behavior:
Entities should be removed or handled without causing excessive log warnings or performance issues, even when chunk status updates are occurring.

Actual Behaviour:

Entities are being prevented from removal during world updates, leading to server log warnings and potential memory management issues.

Additional Context:

The Moonrise mod author has suggested that this issue results from how entities are handled during chunk status updates, and noted that improper entity removal during these updates can lead to memory leaks in Vanilla Minecraft. Moonrise mitigates this by flagging the issue in the logs, but the warnings persist, pointing to a conflict with how Collective handles entities.

Would appreciate any guidance on improving compatibility between Collective and Moonrise, or a potential solution to avoid these entity removal issues.