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.

mikestah

Members
  • Joined

  • Last visited

  1. Oh that makes a lot of sense, thank you!
  2. I'm new to modding, but I'm trying to make a mod that replaces the hunger effect with weakness. It should check if the player has received the hunger effect, then add a weakness effect of equal strength/duration, and then remove the hunger effect. However, for some reason it won't remove the hunger effect. I'm really hoping someone can explain why it doesn't work and give criticism if I have any bad practices. Below is the event handler class. Thanks in advance! @Mod.EventBusSubscriber(modid = StahTweaks.MOD_ID, bus = Mod.EventBusSubscriber.Bus.FORGE, value = Dist.CLIENT) public class ModClientEvents { @SubscribeEvent /** Theoretically checks if the effect gained is hunger and then replaces * it with a weakness effect of equal strength */ public static void onPlayerHungerEffect(PotionEvent.PotionAddedEvent event) { LivingEntity player = event.getEntityLiving(); EffectInstance effect = event.getPotionEffect(); if(effect.getPotion().equals(Effects.HUNGER)) { player.addPotionEffect(new EffectInstance(Effects.WEAKNESS, effect.getDuration(), effect.getAmplifier())); player.removePotionEffect(Effects.HUNGER); } } }

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.