Solved Remove wither shield/armor?

Discussion in 'Spigot Plugin Development' started by YogurtSmudge, Jan 21, 2020.

Thread Status:
Not open for further replies.
  1. I'm trying to remove a wither's "armor" effect that it gets when it drops below half of its health.

    NOTE: A wither gets its "armor" once when it initially spawns and once again when it drops below half health.
    [​IMG]

    I quickly checked events but found none.

    I tried making a custom wither class but to no avail. I tried overriding this method:
    Code (Java):
        public boolean cm() {
            return this.getHealth() <= this.getMaxHealth() / 2.0F;
        }
    Which returns a boolean on whether or not the wither is armored. This didn't work either. I also tried overriding another method that uses the DataWatcher.

    Code (Java):
        public int getInvulTime()
        {
            return this.dataWatcher.getWatchableObjectInt(20);
        }
    Surprisingly, it didn't work. Anyone have any solution or any way of achieving this?
     
  2. This might be client side, I'll look into that for you. If you'd like an alternative, I suggest making the custom wither class and once the wither gets to right above half HP, make a boolean that it is _internally_ on "phase 2," while setting it's HP back to max. Then when it gets back to half HP, kill it.
     
    • Winner Winner x 1
  3. I'm trying to remove the wither armor for my custom boss bar, it works incredibly good. The problem comes with how "filled" I set the boss bar, anything below half health and you can see the wither "armor" floating.

    Edit: Found a solution that is somewhat efficient.
     
    #3 YogurtSmudge, Jan 21, 2020
    Last edited: Jan 21, 2020
  4. Ohhh didn't know you were doing it for a boss bar. I'd recommend an EnderDragon and hiding that, or sending packets to the clients of the wither spawning without actually spawning it. Otherwise you can look at the source of BossBarAPI (alternatively on Spigot here) and see how it's done by the author there.
     
    • Winner Winner x 1
Thread Status:
Not open for further replies.