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.

Panferno18

Members
  • Joined

  • Last visited

  1. So, i want to make i mod that inclues armor which is invulnerable against the Weapons and Tools of Draconic Evolution. My code for this event works perfectly fine against all of the weapons and tools of DE, except for the Bows/Arrows. I don't understand why, because both of the Bows extend "ToolBase". Anyone can help me? Here's the code: package com.Panferno18.againstthedragons.event; import com.Panferno18.againstthedragons.items.armor.HunterArmor; import com.Panferno18.againstthedragons.util.Reference; import com.brandon3055.draconicevolution.items.tools.ToolBase; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumHand; import net.minecraftforge.event.entity.living.LivingAttackEvent; import net.minecraftforge.fml.common.Mod.EventBusSubscriber; import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @EventBusSubscriber(modid = Reference.MOD_ID) public class ArmorEvents{ @SubscribeEvent(priority = EventPriority.HIGH) public static void onDragonAttack(LivingAttackEvent event) { EntityLivingBase entity = event.getEntityLiving(); if (event.getSource().getImmediateSource() instanceof EntityPlayer) { EntityPlayer attacker = (EntityPlayer) event.getSource().getImmediateSource(); ItemStack weapon = attacker.getHeldItem(EnumHand.MAIN_HAND); if (!(weapon.getItem() instanceof ToolBase)) return; } else return; boolean draconicAlert = true; for (ItemStack stack : entity.getArmorInventoryList()) { if (!(stack.getItem() instanceof HunterArmor)) draconicAlert = false; } if (draconicAlert) { event.setCanceled(true); } } }

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.