1.12.2 How to give the wither shield effect to player/entity

Discussion in 'Spigot Plugin Development' started by dfaldfjd, Jan 26, 2021.

  1. I am currently wondering if I could code a plugin for a new potion brewed with a nether star, which will give the wither shield effect to the player who consumes it. I'm wondering if it would even be possible to do something like this, as I've seen in the wiki that it is something that you can't give to players, and heard somewhere else it was clientside. All help is appreciated.
  2. You can do
    Code (Java):

    player.addPotionEffect(new PotionEffect(PotionEffectType.WITHER, {DURATION}, {AMPLIFIER}));
    Replace {DURATION} with the duration you want and {AMPLIFIER} with the amplifier.
  3. Yeah, the wither shield is something that is exclusive to the wither. It is not a potion effect or even something you can set from the server-side, the client simply renders the shield effect whenever the wither gets to a certain health level.

    EDIT: Wait, I just realised this is another post from January. Please excuse the necroposting.
  4. I really don‘t get why everyone opposes answering old threads. Someone might google the same question, so why shouldnt we answer?