Solved Simple event doesn't work

Discussion in 'Plugin Development' started by ZodiacTheories, Jul 26, 2014.

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

    ZodiacTheories

    Hi, this isn't working, no messages or anything, and yes, I have registered my events:

    Code:java
    1. @EventHandler
    2. public void onPlace(BlockPlaceEvent e) {
    3. if(e.getBlock().getType() == Material.FIREWORK) {
    4. e.setCancelled(true);
    5. }
    6. }


    I think it is something to do with Firework being a block.

    Thanks
     
  2. Offline

    TheMcScavenger

    You don't place a firework. You have to get the playerinteractevent, check if it's a firework, and then cancel the event. For future reference, add "Bukkit.broadcastMessage("test");" in your code to see where it stops functioning.
     
    TigerHix likes this.
  3. Offline

    xTigerRebornx

    ZodiacTheories Firework is an item, use the PlayerInteractEvent if you want to manipulate its spawning.
     
    TigerHix likes this.
  4. Offline

    ZodiacTheories

Thread Status:
Not open for further replies.

Share This Page