Solved Incompatible operand types MaterialData and int

Discussion in 'Plugin Development' started by Twisted_Panda, Dec 21, 2013.

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

    Twisted_Panda

    Code:
    if(pl.getItemInHand().getType() == Material.INK_SACK && (pl.getItemInHand().getData() == 4)){
    I don't understand how to get the data, of an ink sack.
     
  2. Offline

    mrkirby153

    Twisted_Panda

    What the heck are you trying to do? The code right now checks for an ink sack. If you want the data ([id]:[data]) then ink sack is all you need. That is if ink sacks have the data of 4. You don't need to check the matrial data. Material data gets all the extra attributes of the item like its lore.
     
  3. Offline

    xTrollxDudex

    Twisted_Panda
    Try doing
    PHP:
    pl.getItemInHand().getData().getData() == (byte4
     
    Twisted_Panda likes this.
  4. Offline

    Twisted_Panda

    Thanks.
     
Thread Status:
Not open for further replies.

Share This Page