'Grave' not working

Discussion in 'Plugin Development' started by sgavster, Oct 29, 2013.

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

    sgavster

    Hi everyone! I was playing with a 'grave' but it wont work, I have this:
    Code:java
    1. public void onDeath1(PlayerDeathEvent e)
    2. {
    3. if(e.getEntity() instanceof Player)
    4. {
    5. Player p = e.getEntity();
    6. p.sendMessage("work1");
    7. Location cstl1 = new Location(p.getWorld(), p.getLocation().getX(), p.getLocation().getY() - 2, p.getLocation().getZ());
    8. Location cstl2 = new Location(p.getWorld(), cstl1.getX(), cstl1.getY(), cstl1.getZ() + 1);
    9. Location gl1 = new Location(p.getWorld(), p.getLocation().getX(), p.getLocation().getY() - 1, p.getLocation().getZ());//gravel
    10. Location gl2 = new Location(p.getWorld(), p.getLocation().getX(), p.getLocation().getY() - 1, p.getLocation().getZ() + 1);//gravel
    11. Location cl1 = new Location(p.getWorld(), p.getLocation().getX(), p.getLocation().getY() + 1, p.getLocation().getZ() + 2);//cobblebottom
    12. Location cl2 = new Location(p.getWorld(), p.getLocation().getX(), p.getLocation().getY() + 2, p.getLocation().getZ() + 2);//cobbletop
    13. Location sl1 = new Location(p.getWorld(), p.getLocation().getX(), p.getLocation().getY() + 1, p.getLocation().getZ() + 1);//sign
    14.  
    15.  
    16. Block b = cstl1.getBlock();
    17. p.sendMessage("work2");
    18. cstl1.getBlock().setType(Material.CHEST);
    19. cstl2.getBlock().setType(Material.CHEST);
    20. gl1.getBlock().setType(Material.GRAVEL);
    21. gl2.getBlock().setType(Material.GRAVEL);
    22. cl1.getBlock().setType(Material.COBBLESTONE);
    23. cl2.getBlock().setType(Material.COBBLESTONE);
    24. sl1.getBlock().setType(Material.SIGN);
    25. Sign sign = (Sign) sl1.getBlock().getState();
    26. sign.setLine(0, "R.I.P");
    27. sign.setLine(1, p.getName());
    28. sign.update();
    29. p.sendMessage("work3");
    30. Chest c = (Chest) b.getState();
    31. DoubleChest chest = (DoubleChest) c.getInventory().getHolder();
    32. Inventory inv = chest.getInventory();
    33. p.sendMessage("work4");
    34.  
    35. inv.setContents(p.getInventory().getContents());
    36.  
    37. e.getDrops().clear();
    38.  
    39. p.sendMessage("§3[§4Quadular§6MC§3 §6Your grave is now at: §2X: " + cstl1.getX() + " Y: " + cstl1.getY() + 1+ " Z: " + cstl1.getZ());
    40. }
    41. }


    But it's not working, it doesn't say any of the debug messages. Events are registered!

    Thanks for any help.
     
  2. Offline

    Jogy34

    @EventHandler?

    Also, Material.SIGN is the item, you want either Material.SIGN_POST or Material.WALL_SIGN.
     
  3. Offline

    sgavster

    Jogy34 AHAHAHAHA, silly mistakes.. thank you! lol. and oh! fixed.
    How can I make it so the sign faces North?
     
  4. Offline

    Jogy34

Thread Status:
Not open for further replies.

Share This Page