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.

Featured Replies

Posted

Hey all, I'm sure I missed something simple, but I'm trying to create a a custom potion that acts like multiple Vanilla potions combined together. In this example, I'm trying to create a potion that acts like a Slowness, Mining Fatigue, and Health Boost potion all in one.

 

The Slowness and Health Boost attributes get modified correctly when the effect is given to the player, however, the Mining Fatigue attribute seems to remain unchanged, and I cannot figure out why. Any and all help is appreciated. Many thanks!

 

public class PotionExample extends Potion {
    public PotionExample(boolean isBadEffect, int liquidColor){
        super(isBadEffect, liquidColor);
        this.registerPotionAttributeModifier(SharedMonsterAttributes.ATTACK_SPEED, MathHelper.getRandomUUID().toString(), -3.0D, 2);
        this.registerPotionAttributeModifier(SharedMonsterAttributes.MOVEMENT_SPEED, MathHelper.getRandomUUID().toString(), -0.5D, 2);
        this.registerPotionAttributeModifier(SharedMonsterAttributes.MAX_HEALTH, MathHelper.getRandomUUID().toString(), 4.0D, 0);
    }
  
  	@Override
    public void performEffect(EntityLivingBase entityLivingBase, int amplifier) {
        super.performEffect(entityLivingBase, amplifier);
    }

    @Override
    public boolean isReady(int duration, int amplifier) {
        return true;
    }
}

 

Edited by IronIngotGuy

  • Author
5 hours ago, diesieben07 said:

I suspect your modifier is just too large, try using a smaller number (or rather bigger, since it's negative) than -3. Vanilla uses -0.1 for mining fatigue.

Also, do not generate a new UUID every time. Pick one UUID and stick to it, like vanilla does.

Thank you! After making those tweaks, the hand animation seems to have changed fine. However, it seems like the dig speed has been unchanged. It looks like the EntityPlayer class's dig speed is hardcoded around the Haste and Mining Fatigue Potions specifically. Is there a way around this to mimic Mining Fatigue's digging speed changes on the player?

Thanks again

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

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.