My first Plugin. But need help.

Discussion in 'Plugin Development' started by cruz2000, Oct 29, 2013.

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


    Alright so am starting to make my own plugin but i get this error Ive been using the Plugin tutorial on wiki and following the steps and reading and learning.And the plugin i want to make is [Killing the player]. I get this line in set health and i dont know why.

    Screen shot 2013-10-29 at 9.34.27 PM.png
  2. Offline


    cruz2000 setHealth(0.0);
    setHealth(0); will give you a warning but it will still work.
  3. Offline


    the line usually means that the method "setHealth" is deprecated. Deprecated means that some time in the future, bukkit will probably remove the setHealth method, and at that time any plugin using the deprecated method will no longer function properly.

    Before they remove the deprecated method, bukkit will introduce an alternative method to accomplish the same task, and it will be the responsibility of plugin developers to update their plugins to use the new methods.

    In this case of setHealth(0), using an Integer as the argument is deprecated, the preferred method uses a double instead: setHealth(0.0)
  4. Offline


    cruz2000 Try to use target.setHealth(target.getHealth() - target.getHealth());?
  5. Offline


    Why not just set it to 0 rather than making the server do a calculation (albeit simple)?
  6. Offline



    Use that? It will also do animation :D
    TheCombatCA and Jake6177 like this.
  7. Offline


    Not necessary, just use 0.0 or 0D with the setHealth() method :)
  8. Offline


    Thank you all! helped :). Very pleased with the help here! Thank you . You are all helpful! But one problem :( .

    1. 23:05:44 [INFO] cruz2000 issued server command: /killplayer
    2. 23:05:44 [SEVERE] null
    3. org.bukkit.command.CommandException: Unhandled exception executing command 'killplayer' in plugin KillingPlayer v1.0
    4. at org.bukkit.command.PluginCommand.execute(
    5. at org.bukkit.command.SimpleCommandMap.dispatch(
    6. at org.bukkit.craftbukkit.v1_6_R3.CraftServer.dispatchCommand(
    7. at net.minecraft.server.v1_6_R3.PlayerConnection.handleCommand(
    8. at
    9. at net.minecraft.server.v1_6_R3.PlayerConnection.a(
    10. at net.minecraft.server.v1_6_R3.Packet3Chat.handle(SourceFile:49)
    11. at net.minecraft.server.v1_6_R3.NetworkManager.b(
    12. at net.minecraft.server.v1_6_R3.PlayerConnection.e(
    13. at net.minecraft.server.v1_6_R3.ServerConnection.b(SourceFile:37)
    14. at net.minecraft.server.v1_6_R3.DedicatedServerConnection.b(SourceFile:30)
    15. at net.minecraft.server.v1_6_R3.MinecraftServer.t(
    16. at net.minecraft.server.v1_6_R3.DedicatedServer.t(
    17. at net.minecraft.server.v1_6_R3.MinecraftServer.s(
    18. at
    19. at
    20. Caused by: java.lang.Error: Unresolved compilation problem:
    21. o cannot be resolved
    23. at me.cruz2000.KillingPlayer.onCommand(
    24. at org.bukkit.command.PluginCommand.execute(
    25. ... 15 more
    26. >

    I get this error.
Thread Status:
Not open for further replies.

Share This Page