Run method (not in-game command) upon chat click.

Discussion in 'Plugin Development' started by Deity.-, Aug 17, 2019.

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

    Deity.-

    I am making a plugin for my server, and I need to be able to run a method when a player clicks a certain message in the chat. I have looked everywhere I could find to find some way to do this, but every thread I've found has been asking to run a command like /tp sendersName x y z, but I need a way to run a method I've created like runThisMethod(args...).
    Having a programming background, I expect that there must be something akin to Java's component.addMouseListener(). I know I could get around this by setting some flag in game and running a loop to check if that flag's value was changed, but this is very inefficient and would likely slow down the server too much. Is there anything in Bukkit for this or some way I could create this myself without changing the API?
     
  2. Online

    timtower Moderator Moderator

    @Deity.- addMouseListener would be clientside if existing, not serverside, so won't work with Bukkit.
    But there is no way to do this, the best that you can do is to run a command.
     
Thread Status:
Not open for further replies.

Share This Page