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.

khris002

Members
  • Joined

  • Last visited

Everything posted by khris002

  1. Hi, I'm new to java and I am making testing mods, I'm learning how this all works and I have a little trouble, that I don't understand. I want to add potion effect to testing armor by "if" but... this is not working. No errors, just when I'm wearing testing helmet there is no potion effects. Here is my code: package com.test.testmod.items; import com.test.testmod.util.RegistryHandler; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.inventory.EquipmentSlotType; import net.minecraft.item.ArmorItem; import net.minecraft.item.IArmorMaterial; import net.minecraft.item.ItemStack; import net.minecraft.potion.EffectInstance; import net.minecraft.potion.Effects; import net.minecraft.world.World; public class ArmorEffect extends ArmorItem { public ArmorEffect(IArmorMaterial materialIn, EquipmentSlotType slot, Properties builder) { super(materialIn, slot, builder); } @Override public void onArmorTick(ItemStack itemstack, World world, PlayerEntity player){ if ( player.getItemStackFromSlot(EquipmentSlotType.HEAD).getItem() == RegistryHandler.TEST_HELMET.get() ) { player.addPotionEffect(new EffectInstance(Effects.FIRE_RESISTANCE, 300, 1, false, false)); } } }

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.