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.

Sinu

Members
  • Joined

  • Last visited

  1. Thanks for the reply. I will work around it for now!
  2. Sweet, that seems to have worked! The one issue is that, I had to check if the instance was client or server because for some reason the server kept thinking the light level of the player is always 0 (is it client-side only?). So my code looks like this now: PlayerEntity player = event.player; World world = event.player.level; BlockPos blockpos = player.blockPosition(); BlockState block = world.getBlockState(blockpos); if (world.isClientSide) { System.out.print(world.getMaxLocalRawBrightness(blockpos) + System.lineSeparator()); if (world.getMaxLocalRawBrightness(blockpos) == 0) { ((LivingEntity)event.player).addEffect(new EffectInstance(Effects.BLINDNESS, 20, 3)); } } But now once I walk out of the light level of 0, it still says that I have the Blindness effect even though I can see clearly. I am assuming that since I checked if the instance is client-side or not, it didn't actually give the potion effect according to the server (which makes sense) but I don't understand why Blindness goes away even after I walk into the light?
  3. Thanks, that seems to have worked!
  4. I see. What is the second int parameter in World#getRawBrightness for? I looked at the reference and it just seems to subtract it? Not sure why.. Also I believe I tried using World#getBrightness with LightType.BLOCK but I don't think it detected the light level properly. I am trying to give the Blindness effect to players who walk into caves with light levels of 0.
  5. Will this also work if I put this in BlockEvent.BreakEvent? Let's say I check if the player is breaking a Stone block and trying to replace that with something else.
  6. I am trying to give a blinding effect to players who are in light level of 0 but I can't seem to get it to work. @SubscribeEvent public static void onPlayerTick(TickEvent.PlayerTickEvent event) { PlayerEntity player = event.player; World world = event.player.level; BlockPos blockpos = player.blockPosition(); BlockState block = world.getBlockState(blockpos); if (block.getLightValue(world, blockpos) == 0 && block != null) { ((LivingEntity)event.player).addEffect(new EffectInstance(Effects.BLINDNESS, 20, 3)); } } Am I using getLightValue correctly? Also I am correctly feeding in the correct block position?
  7. So you just downloaded my source code and loaded it up and it doesn't allow you to create the Fishing Rod? I can still craft it and I uploaded exactly as is and I haven't touched it.
  8. How will that fix my crafting issues with fishing_rod.json file when it doesn't even use/reference any tags I added in that folder?
  9. All the ones in data.forge.tags?
  10. I have no idea what you mean either. Can you be more specific? Which json file are you talking about?
  11. For the String and Rods (sticks)?
  12. https://github.com/krimsungh/Brimheim
  13. Well I can still craft the Fishing Rod even after I changed it.
  14. Right. I get that. But what is my "dependencies"? [[dependencies.???]] my own mod ID?? I know its definitely not examplemod. I did: [[dependencies.brimheim]] modId="forge" mandatory=true versionRange="[36,)" ordering="AFTER" side="BOTH" Is that correct?
  15. So we are talking about the mods.toml inside META-INF folder? Ex: Projects\Minecraft\Brimheim\src\main\resources\META-INF. This is the only mods.toml I can find inside my MDK. But what am I adding dependency of? I get that I need to set the "ordering" to AFTER but what am I setting the "ordering" of? Forge??

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.