Listeners, Timers & Teleports help <

Discussion in 'Plugin Development' started by n00bl3, Dec 27, 2014.

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

    n00bl3

    So I tried to make a Teleport Stone Plugin where if you right click with a diamond in your hand and it's display name is Test Teleport Stone it will teleport to a set location, but I have 2 errors that I don't know how to fix :/

    http://pastebin.com/NgFHapAZ

    Errors are commented. Please halp. (I'm new to the whole Java coding thing, don't be too rough)

    The error on timer is "timer cannot be resolved to a variable"
    The error world is "world cannot be resolved to a variable"
     
  2. Offline

    timtower Administrator Administrator Moderator

    @n00bl3 Please post your full server log.
     
  3. Offline

    n00bl3

    http://pastebin.com/W0mk012g

    Console from startup

    The plugin appears to enable, but nothing happens when doing what the listener is listening for <MKODragonQuest> being the plugin I tried to make. It also shows up when I do /pl.
     
  4. Offline

    timtower Administrator Administrator Moderator

    @n00bl3 You don't have @Eventhandler
    And you don't register it either
     
  5. Offline

    n00bl3

    So the errors that are shown on eclipse? Do I just ignore them?/Will the things I'm missing fix the errors shown?

    And thanks on the things I'm missing, I'll go learn about them
     
  6. Offline

    Mysticate

    Your problem is that you're trying to use non-existant variables. Your 'timer' variable which you use to define the task has to be an integer variable, preferably defined in the area above your onEnable().

    Code:
    int timer;
    You are attempting to use the Location constructor with an undefined variable. 'world.' You have to input an actual world here, and since I'm assuming that the name of your world is 'world,' you will use this code to get the world called 'world.'

    Code:
    World world = getServer().getWorld("world");
    Put that code above the world constructor to create a world Object.

    I hate to repeat so many other people on here, but before attempting Bukkit, you should have a decent comprehension of Java.
     
  7. Offline

    JordyPwner

    If im not blind where are:
    onEnalbe()?
    onDisable()?
    Registered Events?
    @Eventhandler?
     
Thread Status:
Not open for further replies.

Share This Page