How to check if a certain item was removed from the chest

Discussion in 'Plugin Development' started by Heckya1234 (The_3_gamers), Mar 3, 2014.

Thread Status:
Not open for further replies.
  1. This is my current code for checking what was moved

    Code:java
    1. if(event.getItem()) == item.getType() == Material.REDSTONE_BLOCK){event.setCancelled(true);}


    It gives me a Incompatible operand types Item and Material
    The item is org.bukkit.block.Block
    I need help please
     
  2. Offline

    Barinade

    if(event.getItem()) == item.getType() == Material.REDSTONE_BLOCK)
    if (event.getItem().getType() == Material.REDSTONE_BLOCK)
     
  3. Nope gives me a different error Incompatible operand types EntityType and Material
     
  4. Offline

    Barinade

    On what line?
     
  5. use getItem().getItemStack(), then compare the type.
     
  6. Offline

    Barinade

    ^ right. 7 AM, haven't slept, that one slipped.
     
  7. That doesnt work I got to this but got The left-hand side of an assignment must be a variable

    Code:java
    1. if (event.getItem().getItemStack() =Material.REDSTONE_BLOCK)
     
Thread Status:
Not open for further replies.

Share This Page