Filled Throwable Daggers

Discussion in 'Plugin Requests' started by Xp10d3, May 28, 2020.

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

    Xp10d3

    Plugin category: PvP?

    Minecraft version: 1.9.4

    Suggested name: Throwable Daggers

    What I want: Basically the ability to throw “daggers”. I am going to be using this for my MMORPG server and since it will use MyItems, I can use a texture pack and copy the Custom Model Data to simulate a dagger and than use MyItems to change the amount of damage it does as well as other such NBT properties. Anyways, I want it so that if you use the command:
    /createdagger
    It will take whatever item you hold in your hand and add it to a config file of some kind. What it will copy will include all NBT data and model data so that if you find the same item and right click it, it will disappear from your hand and shoot an “arrow” as if you used a bow, but instead of doing standard bow damage it will do whatever damage was on the item (MyItems can change the amount of damage and item does using NBT data). The dagger will also disappear from your hand.

    Ideas for commands:
    /createdagger: Adds whatever item you hold in your hand to a config file copying NBT data and model data (includes title, lore, type of item, etc.)
    /removedagger: Removes the dagger from the config file based on what item you are holding.
    /dagger <property>: Adds an effect to the dagger. This means that if a player holds the item in your hand, than if the dagger hits another player they will be effected with whatever was on the dagger. Item has to have the same NBT data that the player holds in order for it to work. The effect can be anything that existed in 1.9.4 (example poison II, poison, levitation, etc.)

    Ideas for permissions:
    dagger.*: Access to all commands.
    dagger.create: Allows use of /createdagger.
    dagger.remove: Allows use of /removedagger.
    dagger.effect. Allows use of /dagger <property>

    When I'd like it by: As soon as possible.

    EDIT: If possible make the projectile of the actual dagger have a custom model data so I could either make it invisible or using a texture pack make it look like an actual dagger flying through the air.
     
    Last edited: May 29, 2020
  2. Online

    Xp10d3

  3. Offline

    Legendary_zotar

    @Xp10d3
    So if they have the exact same item, including custom name, lore, nbttag, etc... they will be able to throw that dagger right?

    Also if setting the damage from another plugin then we cant really make a plugin to get its damage without knowing how it works or an API, And from what i saw, its a paid plugin.

    If you'd like i can make it, but it wouldn't rely on the other plugin
     
    Last edited: May 31, 2020
  4. Online

    Xp10d3

    To answer your question yes. If all NBT tags, custom names, and lore match they will be able to throw the dagger. Also MyItems pro is paid but I'm using the free version which changes the NBT tag to modify how much damage it does. And not relying on another plugin is perfectly fine :)
     
  5. Offline

    Legendary_zotar

    @Xp10d3 What about the projectiles how would you like them?
     
  6. Online

    Xp10d3

    Basically when you right click a dagger, it will act as a bow in a way. It will fire an arrow at a bow's normal speed, however I'd like the arrow to have an option to have a model data so that I can make the arrow invisible or change the texture of the projectile. But the projectile's are basically arrows. I also would like it so that if you are holding a dagger and use the command /dagger <property> it would add an effect to the dagger so that if you throw it, any player/entity that is hit with that dagger will add an effect to that entity. So for example if I am holding a dagger and do /dagger poison_two and throw it, any entity that is hit with that dagger will get poison II. The same goes for if I use the dagger and hit an entity with it.
     
  7. Online

    Xp10d3

    @Legendary_zotar Hey are you doing this plugin? If so how is it going so far?
     
  8. Offline

    Legendary_zotar

    Oh sorry, I got very busy and wasn't able to make it. I still am, if there is anyone who is willing to take over feel happy to.
    If i'm done with everything and it hasn't been taken over, ill make it.
    sorry
     
  9. Online

    Xp10d3

    Legendary_zotar likes this.
  10. Online

    Xp10d3

  11. Online

    Xp10d3

  12. Online

    Xp10d3

  13. Online

    Xp10d3

  14. Offline

    gochi9

    MyItems does not have an API to work with.So getting things like the Ability,Lore Stats,Special Power are is impossible.Not impossible but unsuable. The best thing you could do is to change the request into getting the items DisplayName (and lore maybe),since it is easier and maybe give you the ability to modify the damage or/and add potionEffects to the target and completly scrap the idea of linking this to MyItems
     
  15. Online

    Xp10d3

    I didn't necessarily say it has to be hooked into MyItems. The Abilities, Lore Stats, etc. is not necessary. The abilities and such are separate and only takes into effect when right clicking the item or hitting a target. I did a bit of Spigot API in the past and would think that just adding an item based on it's NBT data will suffice in order to check if it's a dagger or not. Hooking into MyItems is not possible as it's not an API, but if you check how much damage the dagger does just by hitting a target and then applying that damage to another player that will work as well.
     
  16. Offline

    gochi9

    Ok so if i understand correctly.You just to have one or as many items as you want and if you click one of them (doesn't matter what kind of material) it will shoot an arrow that you can modify the damage and maybe add potion effect.Correct? If yes then does it need arrow in the inventory or it just shoots and arrow.Also i think you want a cooldown between shots. Correct me if i am wrong.
     
  17. Online

    Xp10d3

    @gochi9 Yes that is correct. And a cool down would be nice :) But I honestly think that if you just have the dagger be removed from the inventory entirely, a cool down won't be necessary. Sorry I am probably making things confusing...
     
  18. Offline

    gochi9

    This is the plugin

    So a lot to explain.

    First to create a dagger you use the following format:
    *Hold desired item in hand*
    Permission: daggers.createdagger
    /createitem <id> <boolean infinite> <dagger damage> <PotionEffect>
    Now let me break this down
    /createitem <id - this is the id of the dagger example: id1/dagger1 something like that> <boolean - set this to true the item will be able to shoot arrow without getting deleted from the inventory (TRUE or FALSE, if you put anything else or misspell it and it will be set to FALSE> <double - the damage of the dager> <Potion - Here you either enter the name of a potion (Example POISON,WITHER) or if you do not want to add a potion effect you will write 'null'>

    Now to modify the dagger
    The cooldown is set to default at 1
    The potion effect (if you added one) duration is set to 20 seconds and the amplifier is set to 1
    Permission: daggers.modifydagger

    /ModifyDagger <id> infinite <boolean> - this will change the infinite boolean of the dagger
    /ModifyDagger <id> damage <double> - this modifies the damage of the dagger
    /ModifyDagger <id> cooldown <integer> - this will modify the cooldown between the arrows
    /ModifyDagger <id> potion <potionEffect> <integer - duration> <integer - amplifier> - This modifies the potion effect,duration and amplifier
    /ModifyDagger <id> potion null - this removed the potion from an item

    Now to get the list of the created daggers:
    Permission: daggers.getlist
    /GetDaggerList

    The following command will let you see details about a specific dagger:
    Permission: daggers.getinfo
    /GetDaggerInfo <id>

    The following command will let you remove a dagger from the server
    Permission: daggers.removedagger
    /RemoveDagger <id>

    The following command will let you give a dagger to a player
    Permission: daggers.givedagger
    /GiveDagger <id> <target> <amount>

    The following command will let you reload the config
    Permission: daggers.reloadconfig
    /DaggerRelaod
     
    Legendary_zotar and Xp10d3 like this.
  19. Online

    Xp10d3

    Thank you so much! I'll see if I can try it out tomorrow :) It's late so I'll get back to you once I've tried it out :D
     
  20. Online

    Xp10d3

    Just tested out most of the commands. For some reason the cool down doesn't seem to be working. I'm OPed but I don't seem to get any cool down messages. But other then that everything seems to be working! Thank you so much :D However if you want to fix the cool downs that would be great :)
    EDIT: There also seems to be an error when I try to do the /createdagger command.
    Code:
    > [13:21:51 INFO]: Eltik issued server command: /createdagger 1 true 4.0 poison
    > [13:21:51 ERROR]: null
    org.bukkit.command.CommandException: Unhandled exception executing command 'createdagger' in plugin ThrowableDaggers v1.0
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[patched_1.9.4.jar:git-Paper-773]
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:152) ~[patched_1.9.4.jar:git-Paper-773]
    at org.bukkit.craftbukkit.v1_9_R2.CraftServer.dispatchCommand(CraftServer.java:665) ~[patched_1.9.4.jar:git-Paper-773]
    at net.minecraft.server.v1_9_R2.PlayerConnection.handleCommand(PlayerConnection.java:1387) [patched_1.9.4.jar:git-Paper-773]
    at net.minecraft.server.v1_9_R2.PlayerConnection.a(PlayerConnection.java:1192) [patched_1.9.4.jar:git-Paper-773]
    at net.minecraft.server.v1_9_R2.PacketPlayInChat.a(PacketPlayInChat.java:45) [patched_1.9.4.jar:git-Paper-773]
    at net.minecraft.server.v1_9_R2.PacketPlayInChat.a(PacketPlayInChat.java:5) [patched_1.9.4.jar:git-Paper-773]
    at net.minecraft.server.v1_9_R2.PlayerConnectionUtils$1.run(SourceFile:13) [patched_1.9.4.jar:git-Paper-773]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_242]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_242]
    at net.minecraft.server.v1_9_R2.SystemUtils.a(SourceFile:45) [patched_1.9.4.jar:git-Paper-773]
    at net.minecraft.server.v1_9_R2.MinecraftServer.D(MinecraftServer.java:786) [patched_1.9.4.jar:git-Paper-773]
    at net.minecraft.server.v1_9_R2.DedicatedServer.D(DedicatedServer.java:403) [patched_1.9.4.jar:git-Paper-773]
    at net.minecraft.server.v1_9_R2.MinecraftServer.C(MinecraftServer.java:723) [patched_1.9.4.jar:git-Paper-773]
    at net.minecraft.server.v1_9_R2.MinecraftServer.run(MinecraftServer.java:622) [patched_1.9.4.jar:git-Paper-773]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_242]
    Caused by: java.lang.NumberFormatException: For input string: "4.0"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[?:1.8.0_242]
    at java.lang.Integer.parseInt(Integer.java:580) ~[?:1.8.0_242]
    at java.lang.Integer.parseInt(Integer.java:615) ~[?:1.8.0_242]
    at com.deadshotmdf.ThrowableDaggers.Commmands.CreateDaggerCommand.onCommand(CreateDaggerCommand.java:76) ~[?:?]
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[patched_1.9.4.jar:git-Paper-773]
    ... 15 more
    
    EDIT2: Also the command is /createdagger not /createitem. Please fix this error :)
    @gochi9
     
    Last edited: Jun 20, 2020
  21. Offline

    gochi9

    This is the plugin

    Bug is fixed

    Also if you have not configured the config yet you can delete it and let the plugin regenerate a new one. However if you configured it and don't want to delete it you can add yourself this in the config
    [​IMG]
    Adding this and putting it to 'true' will add cooldowns to everyone(including op's and those with the special permission)
     
    Legendary_zotar and Xp10d3 like this.
  22. Online

    Xp10d3

    @gochi9 Okay. Thank you! I'll try and test this today.
    @gochi9 Seem to get an error when doing /getdaggerlist.
    Code:
    > [16:13:58 INFO]: Eltik issued server command: /getdaggerlist
    > [16:13:58 ERROR]: null
    org.bukkit.command.CommandException: Unhandled exception executing command 'getdaggerlist' in plugin ThrowableDaggers v1.1
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[patched_1.9.4.jar:git-Paper-773]
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:152) ~[patched_1.9.4.jar:git-Paper-773]
    at org.bukkit.craftbukkit.v1_9_R2.CraftServer.dispatchCommand(CraftServer.java:665) ~[patched_1.9.4.jar:git-Paper-773]
    at net.minecraft.server.v1_9_R2.PlayerConnection.handleCommand(PlayerConnection.java:1387) [patched_1.9.4.jar:git-Paper-773]
    at net.minecraft.server.v1_9_R2.PlayerConnection.a(PlayerConnection.java:1192) [patched_1.9.4.jar:git-Paper-773]
    at net.minecraft.server.v1_9_R2.PacketPlayInChat.a(PacketPlayInChat.java:45) [patched_1.9.4.jar:git-Paper-773]
    at net.minecraft.server.v1_9_R2.PacketPlayInChat.a(PacketPlayInChat.java:5) [patched_1.9.4.jar:git-Paper-773]
    at net.minecraft.server.v1_9_R2.PlayerConnectionUtils$1.run(SourceFile:13) [patched_1.9.4.jar:git-Paper-773]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_242]
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_242]
    at net.minecraft.server.v1_9_R2.SystemUtils.a(SourceFile:45) [patched_1.9.4.jar:git-Paper-773]
    at net.minecraft.server.v1_9_R2.MinecraftServer.D(MinecraftServer.java:786) [patched_1.9.4.jar:git-Paper-773]
    at net.minecraft.server.v1_9_R2.DedicatedServer.D(DedicatedServer.java:403) [patched_1.9.4.jar:git-Paper-773]
    at net.minecraft.server.v1_9_R2.MinecraftServer.C(MinecraftServer.java:723) [patched_1.9.4.jar:git-Paper-773]
    at net.minecraft.server.v1_9_R2.MinecraftServer.run(MinecraftServer.java:622) [patched_1.9.4.jar:git-Paper-773]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_242]
    Caused by: java.lang.NullPointerException
    at org.bukkit.ChatColor.translateAlternateColorCodes(ChatColor.java:324) ~[patched_1.9.4.jar:git-Paper-773]
    at com.deadshotmdf.ThrowableDaggers.Utils.DaggerUtils.color(DaggerUtils.java:27) ~[?:?]
    at com.deadshotmdf.ThrowableDaggers.Utils.DaggerUtils.getDaggersList(DaggerUtils.java:189) ~[?:?]
    at com.deadshotmdf.ThrowableDaggers.Commmands.DaggersListCommand.onCommand(DaggersListCommand.java:36) ~[?:?]
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[patched_1.9.4.jar:git-Paper-773]
    ... 15 more
    
    This is when there is no daggers. However it works when there is daggers. Also creating daggers works again! Thanks :D
     
    Last edited: Jun 20, 2020
  23. Offline

    gochi9

    I forgot to add a string in the config.

    Add this in the config: noDaggers: '&aThere are no daggers created'
    then reload it and there you go
     
    Legendary_zotar likes this.
  24. Online

    Xp10d3

    Alright I'll go ahead and try that out once I get the chance :)
     
  25. Offline

    gochi9

    Please report any bugs if there are any or mark it as solved
     
    Legendary_zotar likes this.
  26. Online

    Xp10d3

    @gochi9 sorry forgot to mark this as solved. Seems to work! Thanks :)
     
  27. Offline

    gochi9

    Glad i could help
     
    Xp10d3 likes this.
Thread Status:
Not open for further replies.

Share This Page