Posted September 25, 20196 yr I'm working on a mod to perform an action to the player when a biome transition is detected. Example, I walk from a minecraft:plains biome to a minecraft:forest biome and then my action occurs. I have not been able to find an event to hook into that can listen for a biome edge transition. I'm coding in 1.12.2. Any suggestions?
September 26, 20196 yr Author I had thought of something similar. Are there any concerns for overhead on a check like this?
September 28, 20196 yr Author I'm stumped on how to get the string of the biome name. Could you lend a hand? To elaborate. I am stuck here: Edited September 28, 20196 yr by tyon2006
September 28, 20196 yr Author 11 hours ago, tyon2006 said: I'm stumped on how to get the string of the biome name. Could you lend a hand? To elaborate. I am stuck here: I am no longer stumped. Here's how I got the biome. This example just prints it to console. @SubscribeEvent public void checkBiomeOnTick(PlayerTickEvent event) { //get player's current position BlockPos playerPosition = event.player.getPosition(); //get world biome from players current position Biome currentBiome = event.player.getEntityWorld().getBiomeForCoordsBody(playerPosition); //get biome name data and convert to string String biomeNameString = currentBiome.getBiomeName(); //print biome name to console System.out.println(biomeNameString); }
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.