Odd damage values for potions.

Discussion in 'Plugin Development' started by Lodran, Dec 8, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    Lodran

    I'm working on a plugin that moves potions around, and want to insure that it's moving the right potions at the right times.

    The issue I'm running into is that when I create a org.bukkit.potion.Potion in code using (for example)
    Code:
    (new Potion(PotionType.REGEN).extend().splash())
    and check it's damage value, I get (binary) 0100000001000001.

    If I create the same potion in game, insert it into an item frame, and then check the result's damage value, I get (binary) 0111111111010001 - 7 bits in the middle of the field have changed from zero to one.

    So, my question is, why are those seven digits changing from zero to one, and should I ignore those bits when comparing potions?
     
Thread Status:
Not open for further replies.

Share This Page