Rightclick on a block and send textmessage?

Discussion in 'Plugin Development' started by timtrucker, Jun 26, 2012.

  1. Offline

    timtrucker

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    hey Guys
    how i can send a textmessage, when the player is rightclicking a block?

    thx for help
    lg timtrucker
  2. Offline

    kumpelblase2

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    PlayerInteractEvent -> check if the action is RIGHT_CLICK_BLOCK -> send the message.
  3. Online

    TheGreenGamerHD

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    PHP:

    public void onPlayerInteractBlock(PlayerInteractEvent e){
    player.sendMessage("Sup");
    }
  4. Offline

    caldabeast

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    correction:
    Code:java
    1.  
    2. public void onPlayerInteract(PlayerInteractEvent e){
    3. if(e.getAction == Action.RIGHT_CLICK_BLOCK){
    4. e.getPlayer().sendMessage("Sup");
    5. }
    6. }

Share This Page