My goal is to check whether the player is currently in a certain type of biome; in this case, a forest. I was able to get everything working up until the if statement.
The error I get is 'Operator '==' cannot be applied to 'net.minecraft.world.biome.Biome', 'net.minecraft.util.RegistryKey<net.minecraft.world.biome.Biome>', and I can't say I know exactly what this means. Maybe their types are not compatible? And, if so, how should they be changed?
Also, just as an FYI, I'm fairly new to Minecraft Modding and Java as a whole.
@SubscribeEvent
public static void biomeDetect(LivingEvent.LivingUpdateEvent event) {
LivingEntity player = event.getEntityLiving();
BlockPos pos = new BlockPos(player.getPositionVec());
World world = player.getEntityWorld();
if (world.getBiome(pos) == Biomes.FOREST) {
///execute if player is in forest
}
}