May 13, 20205 yr For custom entities, you can override canDespawn. For vanilla entities, you can use the LivingSpawnEvent.AllowDespawn hook.
May 13, 20205 yr You cannot prevent a single entity from unloading. You can only prevent the chunk it is in from unloading, which will in turn prevent the entity from unloading. Some tips: Spoiler Modder Support: Spoiler 1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code. 2. Always post your code. 3. Never copy and paste code. You won't learn anything from doing that. 4. Quote Programming via Eclipse's hotfixes will get you nowhere 5. Learn to use your IDE, especially the debugger. 6. Quote The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it. Support & Bug Reports: Spoiler 1. Read the EAQ before asking for help. Remember to provide the appropriate log(s). 2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.
May 13, 20205 yr Author When I go to far away it unloads and the chunk is still loaded and with the canDespawn set to false. Is there a way to get a list of unloaded entities? Edited May 13, 20205 yr by Nani1234567890
May 13, 20205 yr 8 minutes ago, Nani1234567890 said: Is there a way to get a list of unloaded entities? There is no way without loading the chunks. What are you trying to achieve? Edited May 13, 20205 yr by DavidM Some tips: Spoiler Modder Support: Spoiler 1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code. 2. Always post your code. 3. Never copy and paste code. You won't learn anything from doing that. 4. Quote Programming via Eclipse's hotfixes will get you nowhere 5. Learn to use your IDE, especially the debugger. 6. Quote The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it. Support & Bug Reports: Spoiler 1. Read the EAQ before asking for help. Remember to provide the appropriate log(s). 2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.
May 13, 20205 yr Author I have this method to get entities Id from uuid and it loops through the loaded entity list. But when the unload they are removed from the loaded entity list and the id return is not correct.
May 13, 20205 yr What are you trying to do from a user's perspective? This is becoming the xy problem. If an entity is unloaded then you should not get it from UUID. Remember: unloaded entities do not exist! You cannot interact with them. Edited May 13, 20205 yr by DavidM Some tips: Spoiler Modder Support: Spoiler 1. Do not follow tutorials on YouTube, especially TechnoVision (previously called Loremaster) and HarryTalks, due to their promotion of bad practice and usage of outdated code. 2. Always post your code. 3. Never copy and paste code. You won't learn anything from doing that. 4. Quote Programming via Eclipse's hotfixes will get you nowhere 5. Learn to use your IDE, especially the debugger. 6. Quote The "picture that's worth 1000 words" only works if there's an obvious problem or a freehand red circle around it. Support & Bug Reports: Spoiler 1. Read the EAQ before asking for help. Remember to provide the appropriate log(s). 2. Versions below 1.11 are no longer supported due to their age. Update to a modern version of Minecraft to receive support.
May 14, 20205 yr Author I have not done anything yet I’m just testing it with printing of the entity is there
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.