FabricMC/yarn

The Entity#checkDespawn method implies that despawning does not occur within the method

haykam821 opened this issue · 0 comments

I think the Entity#checkDespawn method would make more sense if it were named Entity#tryDespawn or similar. The method calls the Entity#discard method itself, rather than returning a boolean. For example, shulker bullets override the method like so:

@Override
public void checkDespawn() {
	if (this.getWorld().getDifficulty() == Difficulty.PEACEFUL) {
		this.discard();
	}
}

Note that a different TraderLlamaEntity#tryDespawn method already exists.