Filled LightningShot

Discussion in 'Plugin Requests' started by Dark_Serpent, Jul 3, 2016.

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

    Dark_Serpent

    Plugin category: Role Playing, Mechanics

    Suggested name: LightningShot

    What I want: I would like the ability to type in a command (/lightningshot (player) (damage) (true/armor)). When this command is entered, the player entered in will fire a lightning bolt akin to Essential's own /lightning.

    This lightning bolt will do damage depending on how much damage was entered. If -e true is entered, it will ignore armor's protection value, while -e armor will account for armor's protection value.

    Commands: /lightningshot
    player, damage, true/armor

    Permissions: None will be needed for this plugin. Permissions default to OP.

    When I'd like it by: Whenever possible! Thank you to anyone who picks this up! :D

    Additional Notes: This plugin must be compatible for 1.7.10! Also, the command must be able to be used via the Console.
     
  2. Hello, as I'm very new to Java it might not be perfect, however I will try to make this for you.
    EDIT: I'm sorry but I'm not going to able to make with and without armour.

    EDIT 2: It's not posible to make this so you can send it from the console!

    EDIT 3: Sorry, I'm not able to do this!
     
    Last edited: Jul 4, 2016
  3. Offline

    Dark_Serpent

    @Jezzerdo4
    It's no problem, thanks for trying! :D
     
  4. Offline

    ipodtouch0218

  5. Offline

    Dark_Serpent

    If you could that would be wonderful!
     
  6. Offline

    ipodtouch0218

    Dark_Serpent likes this.
  7. Offline

    Dark_Serpent

    Thanks so much! I've done some quick testing and here's what I found:
    • When using "true" I get an error. Working on copy and pasting the error from my logs, will edit when I'm done.
    • I apologize if I wasn't clear on this, but when the command is entered, I want the player named in the command to shoot out a "projectile lightning bolt", for lack of a better phrase, instead of the lightning bolt being used at their location, akin to how Essentials' command, "/lightning", will fire a lightning bolt where your crosshair is pointed.
    EDIT:
    Here is the error in question:
    Show Spoiler

    org.bukkit.command.CommandException: Unhandled exception executing command 'lightningshot' in plugin LightningShot v1.0
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[1.7.9-R0.2-SNAPSHOT-1486.jar]
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:180) ~[1.7.9-R0.2-SNAPSHOT-1486.jar]
    at org.bukkit.craftbukkit.v1_7_R3.CraftServer.dispatchCommand(CraftServer.java:726) ~[1.7.9-R0.2-SNAPSHOT-1486.jar]
    at net.minecraft.server.v1_7_R3.PlayerConnection.handleCommand(PlayerConnection.java:999) [1.7.9-R0.2-SNAPSHOT-1486.jar]
    at net.minecraft.server.v1_7_R3.PlayerConnection.a(PlayerConnection.java:830) [1.7.9-R0.2-SNAPSHOT-1486.jar]
    at net.minecraft.server.v1_7_R3.PacketPlayInChat.a(PacketPlayInChat.java:28) [1.7.9-R0.2-SNAPSHOT-1486.jar]
    at net.minecraft.server.v1_7_R3.PacketPlayInChat.handle(PacketPlayInChat.java:65) [1.7.9-R0.2-SNAPSHOT-1486.jar]
    at net.minecraft.server.v1_7_R3.NetworkManager.a(NetworkManager.java:180) [1.7.9-R0.2-SNAPSHOT-1486.jar]
    at net.minecraft.server.v1_7_R3.ServerConnection.c(ServerConnection.java:81) [1.7.9-R0.2-SNAPSHOT-1486.jar]
    at net.minecraft.server.v1_7_R3.MinecraftServer.v(MinecraftServer.java:720) [1.7.9-R0.2-SNAPSHOT-1486.jar]
    at net.minecraft.server.v1_7_R3.DedicatedServer.v(DedicatedServer.java:283) [1.7.9-R0.2-SNAPSHOT-1486.jar
    at net.minecraft.server.v1_7_R3.MinecraftServer.u(MinecraftServer.java:583) [1.7.9-R0.2-SNAPSHOT-1486.jar]
    at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java:489) [1.7.9-R0.2-SNAPSHOT-1486.jar]
    at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:628) [1.7.9-R0.2-SNAPSHOT-1486.jar]
    Caused by: java.lang.NullPointerException
    at me.ipodtouch0218.LightningShot.LightningShot.getDamageReduced(LightningShot.java:97) ~[?:?]
    at me.ipodtouch0218.LightningShot.LightningShot.onCommand(LightningShot.java:74) ~[?:?]
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[1.7.9-R0.2-SNAPSHOT-1486.jar]
     
  8. Offline

    ipodtouch0218

    So you want to make the lightning strike at the players crosshair? I will fix that when I get back home, I'm out right now
     
  9. Offline

    Dark_Serpent

    Yes, thank you! And please take your time :D
     
  10. Offline

    ipodtouch0218

    You said you want it to be executed trough the console, how would that work?
     
    Last edited: Jul 4, 2016
  11. Offline

    Dark_Serpent

    Ah, alright, well, let's see.

    For simplicity's sake, let's say Notch is on the server. You want him to fire at lightning bolt at his crosshair that does 5 damage and ignores armor. In the console, you (or an active plugin) would type the command:

    /lightningshot Notch 5 true

    Meanwhile, in game, Notch would have "shot" a lightning bolt at his crosshair. This would be used with other plugins in order to simulate a sort of "spell cast", in which Notch used a "lightning spell".

    Hope that sums things up!
     
  12. Offline

    ipodtouch0218

    @Dark_Serpent
    Should it just be where he's looking instantly or a projectile going towards where he's looking.
     
    Last edited: Jul 4, 2016
  13. Offline

    Dark_Serpent

    Instantly is what I imagined.
     
  14. Offline

    ipodtouch0218

    Dark_Serpent likes this.
  15. Offline

    Dark_Serpent

    @ipodtouch0218
    I'm finding myself a bit overloaded right now, I'll be sure to test it ASAP! Thanks so much for working on this!

    EDIT:
    @ipodtouch0218
    It works great! Thank you!
     
    Last edited: Jul 5, 2016
    ipodtouch0218 likes this.
  16. Offline

    Dark_Serpent

    @ipodtouch0218
    Found this randomly, it didn't pop up when I first started testing:
    Show Spoiler

    Cannot measure distance between South and North
    at org.bukkit.Location.distanceSquared(Location.java:448) ~[1.7.9-R0.2-SNAPSHOT-1486.jar]
    at me.ipodtouch0218.LightningShot.LightningShot.onCommand(LightningShot.java:86) ~[?:?]
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[1.7.9-R0.2-SNAPSHOT-1486.jar]

    "South" and "North" are different Worlds using the plugin Multiverse. I first did testing in the world South.
     
  17. Offline

    ipodtouch0218

    Last edited: Jul 5, 2016
  18. Offline

    Dark_Serpent

  19. Offline

    ipodtouch0218

    If it's all good, make sure to add the prefix "Filled" to the title

    ThreadTools > Change Title
     
Thread Status:
Not open for further replies.

Share This Page