felinoid Posted November 25, 2019 Posted November 25, 2019 I'm trying to update my mod to 1.14, and I'm having trouble with the part where I replace Minecraft horses with my custom horses. I subscribe to OnEntityJoinWorld events, but when I try to spawn my custom horse in response, the game never loads the chunk. If it happens in the loading screen the game freezes at 100%, or if it happens when a chunk is generated as part of exploration the chunk never loads. My event subscribed code seems to be getting stuck on World.getChunk called from within EntityType.spawn, presumably because it's getting called when the chunk isn't fully loaded yet. Is there a way around this? Quote
felinoid Posted November 25, 2019 Author Posted November 25, 2019 https://github.com/tiffanyjager/horse-colors/blob/master/src/main/java/horse_colors/HorseReplacer.java The problem still happens when replaceHorses is reduced to @SubscribeEvent public static void replaceHorses(EntityJoinWorldEvent event) { // We don't want to replace subclasses of horses if (event.getEntity().getClass() == HorseEntity.class && !event.getWorld().isRemote) { HorseEntity horse = (HorseEntity)event.getEntity(); HorseGeneticEntity newHorse = ModEntities.HORSE_GENETIC.spawn(event.getWorld(), null, null, null, new BlockPos(horse), SpawnReason.CONVERSION, false, false); } } Quote
felinoid Posted November 25, 2019 Author Posted November 25, 2019 Ok, how do I tell when the chunk is loaded? Quote
Recommended Posts
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.