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 there, so I am having an issue with some special armour.

I want it to only get "bypassed" by 1 weapon, and that one weapon does "bypass" it, but it always kills, no matter what I have tried to lessen the blow:

 

 

    @Override
    public ArmorProperties getProperties(EntityLivingBase player,
                                         ItemStack armor, DamageSource source, double damage, int slot) {
        if (source.isExplosion())
        {
            return new ArmorProperties(1, 1.0D, (int) 105.7);
        }
        if (source.setDamageBypassesArmor() != null)
        {
            return new ArmorProperties(1, 1.0D, 500);
        }

        if (source.equals(itemRegist.moneyBlade))
        {
            return new ArmorProperties(1, 1.0D, 500000);
        }
        if (source.causeMobDamage(player) != null)
        {
            return new ArmorProperties(1, 1.0D, (int) 105.7);
        }

        if (source.wither != null)
        {
            return new ArmorProperties(1, 1.0D, 500);
        }
        if (source.canHarmInCreative())
        {
            return new ArmorProperties(1, 1.0D, (int) 100);
        }
        if (source.causePlayerDamage(null) != null)
        {
            return new ArmorProperties(1, 1.0D, (int) 100);
        }

        if (slot == 0 || slot == 3)
        {
            return new ArmorProperties(0, 0.2D, 250);
        }
        return new ArmorProperties(0, 0.3D, 350);

    }

 

 

So the sword in question is "itemRegist.moneyBlade" which normally does +250 attack damage (definitely not OP, I know) but I wanted to reduce it so when a player is wearing this set of armour it only does 5 hearts (or so)

As you can see on the "source.isExplosion" line I have been messing around with numbers trying to make stuff perfect but with the sword attacking, I can't seem to even stop it killing the player (hence the massive number, hoping to at least block all damage, and work it out from there)

 

Any idea on what would be a good way to sort this out. (also a link to how those numbers affect damage would be nice, it took an hour to get that number for the explosion damge - 105 did 1 heart, 106 did 0 hearts, WTF!)

Why bother?

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.