Solved I want to break but not use.

Discussion in 'Plugin Development' started by keaton64, Jun 6, 2014.

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

    keaton64

    So basically I want them to be able to break beds but not use them.
    Because a very large clan on my server has been using them to trap people, as you cannot break beds. I know there has to be some "RIGHT_CLICK" or "LEFT_CLICK" methods, I just can't find any of them anywhere.
    Code:java
    1. @EventHandler
    2. public void onClick(PlayerInteractEvent e){
    3. Block clicked = e.getClickedBlock();
    4. Player clicker = e.getPlayer();
    5.  
    6. if(clicked.getType().equals(Material.BED_BLOCK)){
    7. e.setCancelled(true);
    8. clicker.sendMessage(ChatColor.GRAY + "Beds are disabled on this server");
     
  2. Offline

    MCMatters

    If(e.action == RIGHT_CLICK)
     
  3. Offline

    keaton64

    That confuses me.
    Do I have to import something? Nothing comes up when I use RIGHT_CLICK.
    I used to code clients and they had something like that, but I cannot find anything on bukkit about getting whether a click was right or left.

    It's just
    Code:java
    1. if(e.getAction().equals(Action.RIGHT_CLICK_BLOCK)){
    2.  

    thanks

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 30, 2016
Thread Status:
Not open for further replies.

Share This Page