Jump to content

Recommended Posts

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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