Teleport doesn't work anymore

Discussion in 'Plugin Development' started by TheDavroar, Nov 14, 2013.

Thread Status:
Not open for further replies.
  1. Hey everyone, I am new to coding, so testing everything out a bit. Made a teleporting command first. after that I tried an event with configurable settings. Totally suprised it works (even though sometimes there is no fire, but it works in first place within the first try, so yeah.) but after testing stuff out a bit, i saw my Teleporter isnt working anymore!!!

    I can't get it working anymore, it doesn't even give me an error message anymore just if I use /testport or /tp.

    http://pastebin.com/gv4fXEiL

    I hope this is the correct way to show a java script. Please let me know if I did anything wrong, I just cant get it working..

    Thank you very much!
     
  2. Offline

    cummo15

  3. cummo15 Nope, isn't working.. Too bad :(

    Also found out that my skeletons have explosive arrows too now hahaha! That wasn't meant to be but it's kinda funny.
     
  4. Offline

    amhokies

    TheDavroar
    I don't think you can have two of those onCommand methods. Only one of them will work with the way you are doing them. You can either:
    1) Make use of the CommandExecutor interface
    2) Combine the onCommand methods into one
     
  5. amhokies
    Hmm.. It said there was a duplicate already and I told it to fix it so it made the onCommand1.. Thought it would solve the problem.

    Probably gotta see how I can make the interface or how i can make 1 method of it..

    Thanks alot.


    Edit:
    I made 1 method out of the 2. It worked, thanks a lot!!!!
    Now I gotta see how i can chance the arrow and snowballs only to explode when fired by a humanEntity..

    http://pastebin.com/Cev89StC

    Made that out of it. thanks again
     
  6. Offline

    maxben34

    Ok, well i think it'd be better if you learned java before you coded bukkit. It kinda sounded like you know javascript, which you surely cannot make plugins with.

    You have an explosive arrow code at the top, i dont know if this is your code, cuz you clearly dont know what you wrote in it. If you wantthose explosive arrows, you need to check that the shooter is an instanceof the player class.

    As for your teleport command, i really see nothing wrong. You should have return true (or false, it doesnt matter which) within each if statement inside the command method.

    You have two oncommand methods when you only need one. To fix this, remove the command executor args that you have in your onCommand1() and then move the command from inside that method up to the previous oncommand. One commmand constructor can hold multiple commands.

    You dont, really need an onDisable BTW. It isn't needed in your plugin any longer, but was needd in previous versions of bukkit. You only need to call onDisable if you want something saved, or a method called upon shutdown.
     
  7. Offline

    amhokies

    If you want to get a quick look at using CommandExecutor, here's a tutorial I made a bit ago:

    Just skip forward a bit to where I'm using the CommandHandler class.
     
  8. maxben34
    I know, but this is my first plugin, that's why it's called Test. I'm just messing around a bit and trying to create some things.. It isn't perfect, I know.. But it's a begin.
     
  9. Offline

    maxben34

    That's why I was telling you how you can fix it all up. Hope I helped you.
     
Thread Status:
Not open for further replies.

Share This Page