Skip 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.

Potion Effects on Zombie Pigmen

Featured Replies

Hey guys, i have made an armor, that gives me potion effects...

code is here:

public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
        if (itemStack.getItem().equals(ModItems.binosingum_helmet) || itemStack.getItem().equals(ModItems.texotek_helmet))
        {
            player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 40));
            player.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 40));
        }
        if (itemStack.getItem().equals(ModItems.binosingum_chestplate)){
            player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 40, 2));
            player.addPotionEffect(new PotionEffect(Potion.resistance.id, 40, 2));
        }
        if (itemStack.getItem().equals(ModItems.texotek_chestplate)){
            player.addPotionEffect(new PotionEffect(Potion.regeneration.id, 40, 5));
            player.addPotionEffect(new PotionEffect(Potion.resistance.id, 40, 10));
            player.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 40, 2));
        }
        if (itemStack.getItem().equals(ModItems.binosingum_leggings) || itemStack.getItem().equals(ModItems.texotek_leggings)){
            player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 40, 2));
        }
        if (itemStack.getItem().equals(ModItems.binosingum_boots) || itemStack.getItem().equals(ModItems.texotek_boots)){
            player.addPotionEffect(new PotionEffect(Potion.jump.id, 40));
        }
    }

i want to do the same for Zombie Pigmensso if they pickup my armor that they get the potion effects too

i tried this:

public void onArmorTick(World world, EntityMob entity, ItemStack itemStack) {
        if (itemStack.getItem().equals(ModItems.binosingum_helmet) || itemStack.getItem().equals(ModItems.texotek_helmet))
        {
            entity.addPotionEffect(new PotionEffect(Potion.nightVision.id, 40));
            entity.addPotionEffect(new PotionEffect(Potion.waterBreathing.id, 40));
        }
        if (itemStack.getItem().equals(ModItems.binosingum_chestplate)){
            entity.addPotionEffect(new PotionEffect(Potion.regeneration.id, 40, 2));
            entity.addPotionEffect(new PotionEffect(Potion.resistance.id, 40, 2));
        }
        if (itemStack.getItem().equals(ModItems.texotek_chestplate)){
            entity.addPotionEffect(new PotionEffect(Potion.regeneration.id, 40, 5));
            entity.addPotionEffect(new PotionEffect(Potion.resistance.id, 40, 10));
            entity.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 40, 2));
        }
        if (itemStack.getItem().equals(ModItems.binosingum_leggings) || itemStack.getItem().equals(ModItems.texotek_leggings)){
            entity.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 40, 2));
        }
        if (itemStack.getItem().equals(ModItems.binosingum_boots) || itemStack.getItem().equals(ModItems.texotek_boots)){
            entity.addPotionEffect(new PotionEffect(Potion.jump.id, 40));
        }

    }

but that doesn't work

  • Author

sry i wanna continue with 1.7.10, cant you help me with that potion effect?

  • Guest locked this topic
Guest
This topic is now closed to further replies.

Important Information

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

Account

Navigation

Search

Search

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.