Multiple clicks

Discussion in 'Plugin Development' started by Herowise, Jul 26, 2016.

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

    Herowise

    So My problem is I want to see the series of clicks a player does; like
    Right Click then Left Click then Right Click
    So We all know how to do using PlayerInteractEvent but multiple clicks are the issue. What can I do to solve them?
     
  2. Offline

    SuperSniper

    You could have 2 different lists, once someone does Right Click, add them to the first one, if they're in the first one, and they left click, add them to the 2nd one. If they rightclick while they're in the 2nd one (and also in first one), do stuff.

    This is probably very inefficient, but it's something I thought of right away once I saw this post :p
     
  3. Offline

    Herowise

    Ill try it later and say if it is the effect I desire
     
    Last edited: Jul 26, 2016
  4. Offline

    Zombie_Striker

    @SuperSniper @Herowise
    Use a map instead. The keys will be the Player's UUID and the value will be a String. The String will be a series of either "R" for right, or "L" for left. After the string has a length of ___, split the string at "" (meaning split each at each character) and check what the order is.
     
  5. Offline

    mine-care

    @SuperSniper You can use a map as well to avoid shifting between lists.

    EDIT: Scratch that. Had the page loaded for a while and that didn't include @Zombie_Striker 's post...
     
Thread Status:
Not open for further replies.

Share This Page