MinecraftForge / MinecraftForge

Modifications to the Minecraft base files to assist in compatibility between mods. New Discord: https://discord.minecraftforge.net/
https://files.minecraftforge.net/
Other
6.94k stars 2.69k forks source link

New Event - Item/Entity Out Of World #5215

Closed liketechnik closed 4 years ago

liketechnik commented 6 years ago

I wanted to write a mod for skyblock worlds that counts the items a player throws into the void and after a certain amount summons a mob next to the player. Problem: It seems like there is no easy way to detect if an item was thrown into the void, e. g. it fell out of the world and got despawned.

I already looked how this is handled in forge/vanilla code and it seems fairly easy to add an event for this case. If the general idea would be accepted, I'd prepare a PR with the necessary changes.

liach commented 6 years ago

I suggest listening to entity death events (through forge or IWorldEventListener) and see which ones have y positions less than zero.

liach commented 6 years ago

An alternative is to check LivingDeathEvent's damage source and see if its source is void (out of world) damage. However, it cannot identify if the damage source is the /kill command.

Uh no, an item is not a mob, so the content above in this comment does not apply.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had activity in a long time. If this issue is still relevant and should remain open, please reply with a short explanation (e.g. "I have checked the code and this issue is still relevant because ___." or "Here's a screenshot of this issue on the latest version"). Thank you for your contributions!

stale[bot] commented 5 years ago

This issue has been automatically closed because it has not had activity in a long time. Please feel free to reopen it or create a new issue.

liach commented 5 years ago

This issue appears not to be closed properly.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had activity in a long time. If this issue is still relevant and should remain open, please reply with a short explanation (e.g. "I have checked the code and this issue is still relevant because ___." or "Here's a screenshot of this issue on the latest version"). Thank you for your contributions!

stale[bot] commented 4 years ago

This issue has been automatically closed because it has not had activity in a long time. Please feel free to reopen it or create a new issue.