Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-3813

player.setHealth doen't work reliable

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • Spigot-Server: spigot-1.12.2
      Spigot-API: spigot-api-1.12.2-R0.1
      Client-OS: Win10
      Server-OS- Win10

       

      I've encountered a Bug in a Plugin I currently develop. I couldn't find an an solution for so I've decided to create an Test-Plugin which only has two simple Commands.

      Command "join":

      p.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(6);

      Command "leave":

      p.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(20);
      p.setHealth(20);
      

      Expected behaviour:
      on "/join"
      -  show three hearts.
      -  Three of them full.
      on "/leave":
      -  show ten hearts.
      -  Ten of them full.

      Result:
      on "/join"
      -  show three hearts.
      -  Three of them full.
      on "/leave":
      -  show ten hearts.
      -  Ten of them full.
      It does not always shows the ten hearts as full.
      I coudn't find out why and when it works and when not.
      Strange thinge about it is, that if I use "p.getHealth()" I get "20" even if it only shows 3 full hearts.

       

       

            Unassigned Unassigned
            the_observer6955 Lorenz Lindemann
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: