Determine if Player places item

Discussion in 'Plugin Development' started by narrowtux, Mar 7, 2011.

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


    I'm still working on my MagnetBlock plugin and as it doesn't recognize when a player places an item (redstone, bed, door), I wanted to ask which event is triggered when the player does this.
    I already tried PlayerItemEvent, but the method isBlock() always returns false, so this isn't useable.
  2. Offline

    Edward Hand

    You tried BLOCK_PLACED I assume?
    How about using the getMaterial() property of PlayerItemEvent to check for specific items? There are only a few possibilities so it wouldn't be too bad:
    • Seeds
    • Sign
    • Wooden Door
    • Metal Door
    • Redstone
    • Reeds
    • Cake
    • Bed
    • Diode
    (not paintings because the're entities not blocks)
Thread Status:
Not open for further replies.

Share This Page