Plugin just stops working

  • sorry, this Part is for angriff.

    ah ok sorry I got confused there for a minute :D

    Took out Server Tool and it worked for over an hour but it is wood setting that causes the loss

    ServerTools is not touching keys at all, the full code for it is available on my github and you can check for yourself that it is neither registering, unregistering or in any other way fiddling with your keys. ?(

    I take that back. If I TP it kills it.

    When you say I TP, how are you doing that? Console? Plugin? If a plugin which one? You really need to provide more information for us to help out :/ For starters a full list of all plugins/scripts used. Then what exactly you are doing that leads to your keys not working, a video would go a long way to help as well.

  • ah ok sorry I got confused there for a minute :D

    ServerTools is not touching keys at all, the full code for it is available on my github and you can check for yourself that it is neither registering, unregistering or in any other way fiddling with your keys. ?(

    When you say I TP, how are you doing that? Console? Plugin? If a plugin which one? You really need to provide more information for us to help out :/ For starters a full list of all plugins/scripts used. Then what exactly you are doing that leads to your keys not working, a video would go a long way to help as well.

    sorry, this Part is for angriff.



    ah ok sorry I got confused there for a minute :D

    ServerTools is not touching keys at all, the full code for it is available on my github and you can check for yourself that it is neither registering, unregistering or in any other way fiddling with your keys. ?(

    When you say I TP, how are you doing that? Console? Plugin? If a plugin which one? You really need to provide more information for us to help out :/ For starters a full list of all plugins/scripts used. Then what exactly you are doing that leads to your keys not working, a video would go a long way to help as well.

    I am just now looking at it again. I put the Servertool back in. I have Teleport 1.3.2 installed and if I teleport with that plug in the registered keys no longer work until I reload the plugins. Funny the other day i had another plugin that was writing to a database when someone teleported. The database wrote that teleporters name instead of the event player. I thought it was a anomaly but remembered I had seen something like that before.


    Not wanting to accuse anybody of anything because I don't understand half of it but the person that did after I asked him what he did remarks about the types of plugins I had. I did not know that players can see how many plugins are installed. Maybe it is nothing but I have removed TP and will see if there is some other issue.. The last time I thought I had an issue it turned out to be just a trailing space typo.. :/X/ . Could it be my declarations? Or is there a problem with one plugin turning off key events and another not protecting itself from that ?


    public class Projector extends Plugin implements Listener {
    public Server server;
    private long target;
    private String targetName;
    private Player player;
    private Timer Itime;


    @EventMethod
    public void onPlayerSpawnEvent (PlayerSpawnEvent event){
    player = event.getPlayer();
    player.registerKeys(KeyInput.KEY_R);
    player.registerKeys(KeyInput.KEY_X);
    player.setListenForKeyInput(true);
    server = getServer();
    }

  • I did not know that players can see how many plugins are installed.

    players cannot see how many plugins are installed but ofc if they try common commands for example /pnb and it works then they know that this plugin is installed.

    This part looks fine to me though there is nothing in it really.


    But just a comment why are you saving the player and the player's name as global field variables? that makes no sense as this way previous values can be called in by accident if you don't reinitialise the variables correctly somewhere else in the plugin (i.e. inside the events for instance).

  • players cannot see how many plugins are installed but ofc if they try common commands for example /pnb and it works then they know that this plugin is installed.

    This part looks fine to me though there is nothing in it really.
    But just a comment why are you saving the player and the player's name as global field variables? that makes no sense as this way previous values can be called in by accident if you don't reinitialise the variables correctly somewhere else in the plugin (i.e. inside the events for instance).

    Are you talking about the private Player player;?

  • yes exactly

    Ok well likely comes from not know exactly what the heck I am doing... and examples I see always make that Public. I can see the wisdom of declaring in each event with that overwrite event in the database event. It does make all the players turn green in Netbeans :/


    I will have to look at that other plug in.. If TP or other plugin for that matter is declaring it global would that affect this plugin then ? I was under the impression private would not let it.

  • pretty sure it is TP .. I changed player to the event recompiled loaded it up. Then turned on TP and when the GUI goes away it turns off my key input. ServerTools is back on also but this only happens with a Teleport point move after the GUI goes away.


    public Server server;
    private long target;
    private String targetName;
    //private Player player;
    private Timer Itime;


    @Override
    public void onEnable(){
    registerEventListener (this);
    }


    @EventMethod
    public void onPlayerSpawnEvent (PlayerSpawnEvent event){
    Player player;
    player = event.getPlayer();
    player.registerKeys(KeyInput.KEY_R);
    player.registerKeys(KeyInput.KEY_X);
    player.setListenForKeyInput(true);
    server = getServer();
    }

  • So If I turn on setListenForKeyInput(true) and another plugin turns it false when I use that plugin that plugin then it I no longer look at keys? I guess I need to look at a way to always turn it back on and not just rely on Spawnin Event to set up the ListenForKeyINput for a KeyinputEvent plugin.

  • I will have to look at that other plug in.. If TP or other plugin for that matter is declaring it global would that affect this plugin then ? I was under the impression private would not let it.

    variables declared in one plugin cannot have any impact on another, this is part of how Java is built as a language you can have the same name for two different methods doing completely different things and as long as they are in different packages (like two different plugins necessarily are) they have no problem coexisting.

    So If I turn on setListenForKeyInput(true) and another plugin turns it false when I use that plugin that plugin then it I no longer look at keys? I guess I need to look at a way to always turn it back on and not just rely on Spawnin Event to set up the ListenForKeyINput for a KeyinputEvent plugin.

    yes if another plugin turns it to false then it is false for the player that used the other plugin. I cannot understand why someone would turn that off like that since it can interfere with other plugins but after a quick look at the Teleport plugin's code I am pretty sure you found the culprit.

  • I thought it could not be me because my code was so simple.
    Is there not a way to hide/trap/protect my player from that or reset? I am not up for rewriting that code but if I have too I am comfortable I can come with a basic system but it was not on my agenda.


    Sorry for accusing ST of it.. It was I thought the only plugin I was invoking when I was building.. but obviously not.. Thanks for the confirmation.
    Thanks for the pointer on Player player. I am glad I was not going crazy and crying Wolf!

  • I thought it could not be me because my code was so simple.

    well that is the thing if you had posted the whole plugin code from the beginning I would have definitely known too and we would have checked for other plugins sooner than 30 posts after :D

    Is there not a way to hide/trap/protect my player from that or reset? I am not up for rewriting that code but if I have too I am comfortable I can come with a basic system but it was not on my agenda.

    No unfortunately the only way would be to enable it via a command or have a timer checking if it is enabled and re-enabling it if not. I posted on the Teleport plugin's thread and hopefully the problem will be fixed once the creator sees it.

  • well that is the thing if you had posted the whole plugin code from the beginning I would have definitely known too and we would have checked for other plugins sooner than 30 posts after :D

    No unfortunately the only way would be to enable it via a command or have a timer checking if it is enabled and re-enabling it if not. I posted on the Teleport plugin's thread and hopefully the problem will be fixed once the creator sees it.

    Well a test project for me can look pretty messy and embarrassing with bad attempts commented out. I,also, have some things I am working on that well I wish to remain unique to my server at least until I turn them on in the public server.

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!