Mouse Events ?

Discussion in 'Plugin Development' started by JoeMaximum, Jan 26, 2011.

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


    For testing purpose i want to make a part of code that will make the currently "targeted" bloc of another material, to make it like it is "selected" or is the current "targeted" bloc.

    For now, it update onPlayerMove ... but if i dont move, but move my mouse ... it wont get updated ...
    The onPlayerMove event is not sent when a player move his mouse.

    so is there a way to get some MouseMoveEvent or something similar ?

    Thanks in advance !
  2. Offline


    Try looking at how flashlight does it. You need to import AimBlock then put in your code:
    public Block getBlockInFrontOf(Player player)
    AimBlock aim = new AimBlock(player);
    return aim.getTargetBlock();

    Then you do getBlockInFrontOf(event.getPlayer()); and it will get the block that you look at.
  3. Offline


    I can get the "targeted" block, no problem with that.
    What i want to know is if there is an event when the mouse move?

    If the player is looking around him ... he is not moving so the onPlayerMove event is not triggered.
    What i want, is make the "targeted" block different so you know wich block is the "targeted" block.
    So if you move your mouse around, the "targeted" bloc will change to cobblestone, the get back to his original state once you "target" another block.

    It is working fine, but it only update the "targeted" block when the player move, not when he move the mouse.
  4. Offline


  5. Offline


    Man, this would be fun. Can't wait til it's implemented!

    Going to have to start thinking of uses (not a fan of gestural input in general, but I could think of some things for sure....)
Thread Status:
Not open for further replies.

Share This Page