Posted December 19, 20177 yr Id like to have an if statement check for specific biomes, how would i go about doing so?
December 19, 20177 yr Call Chunk::getBiome(blockpos, World::getBiomeProvider) to find out what biome is at the specified block (yes, biomes are per-block (non-vertical) but stored in the chunk) To find out what chunk you are in, call World::getChunkFromBlockCoords. You can then compare the gained biome to for example Biomes#TAIGA. However, there are a LOT of biomes, and it can get quite messy with if-statements. You can try to generalize it by comparing the biomes temperatures for example Biome::getTempCategory == Biome#TempCategory#WARM. (Using :: to signify non-static methods (needs to be called from an object) and # signifies static methods) Edited December 19, 20177 yr by Matryoshika Also previously known as eAndPi. "Pi, is there a station coming up where we can board your train of thought?" -Kronnn Published Mods: Underworld Handy links: Vic_'s Forge events Own WIP Tutorials.
December 19, 20177 yr Author 10 hours ago, Matryoshika said: Call Chunk::getBiome(blockpos, World::getBiomeProvider) to find out what biome is at the specified block (yes, biomes are per-block (non-vertical) but stored in the chunk) To find out what chunk you are in, call World::getChunkFromBlockCoords. You can then compare the gained biome to for example Biomes#TAIGA. However, there are a LOT of biomes, and it can get quite messy with if-statements. You can try to generalize it by comparing the biomes temperatures for example Biome::getTempCategory == Biome#TempCategory#WARM. (Using :: to signify non-static methods (needs to be called from an object) and # signifies static methods) Sorry for the late reply, but thanks a lot it worked well, and saved me alot of headache and frustration.
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.