Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

sver20

Members
  • Joined

  • Last visited

Everything posted by sver20

  1. So that sort of answers my first question, which was whether their types were compatible or not, and from what I gather the answer to that is no. My second question has to do with how I should change the two conditions to operate correctly. Assuming that 'world.getBiome(pos)' is the RegistryKey object that I can get the biome from, how exactly would I go about doing that? I tried storing it in a variable of type 'Biome', but this made no difference. Biome biome = world.getBiome(pos); if (biome == Biomes.FOREST) { ///execute if player is in forest }
  2. 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 } }

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.