Killcount

Discussion in 'Plugin Development' started by sipsi133, Dec 29, 2013.

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

    et477

    yea but the original guy said that he wants it to be displayed and just the kill coumts that the plyer kills.
     
  2. Offline

    BillyGalbreath

    No, he said he wants it on the lore.
     
  3. Offline

    et477

    uhhhhh i was saying the guy who posted this thread.

    ok i accept defeat but can you explain exactly what you mean by kill count to the weapon?

    @BillyGalbreathhow you get a bukkit dev account.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Aug 3, 2018
  4. Offline

    sipsi133

    BillyGalbreath I used your code after you updated it and still not working.
    et477 I want the KillCount to be shown on weapon, not scoreboard or commandblock.
    But if its much easier to show on scoreboard, tell me how i do it. I have never did anything with scoreboards

    EDIT: et477 I posted this thread
     
  5. Offline

    BillyGalbreath

    So was I. Go back and re-read the first post.
    Are there any errors? If not I'll get on my PC and get it working.

    And about scoreboards/command blocks. You can most definitely use them, however they are even more cumbersome than this to get working. Especially if you are putting a kill count on a weapon instead of on a player.

    The method I wrote for you is exactly what your OP asked to do. If you rack up 100 kills with a sword, you can hand it to a friend and it will still say "Kills: 100" instead of 1 or 0. I thought this was the intended behavior?

    If you want it tied to the player instead, I will have to override some more stuff so the count ties to the player and it updates the count when a player picks it up, etc.
     
  6. Offline

    et477

    im not sure how to tie the kill counts to a weapon but i am looking at the youtube for answers

    you sure that you can do that kind of thing?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 6, 2016
  7. Offline

    sipsi133

    BillyGalbreath I want it to stay on the item. Not player specific. Is it hard to make two lores, one for Entity kills and one for Player kills?
    Error with your code when i kill entity:

    Code:
    11:12:12 [SEVERE] Could not pass event EntityDeathEvent to KillCount v0.0.3
    org.bukkit.event.EventException
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
    va:427)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
    a:62)
            at org.bukkit.plugin.TimedRegisteredListener.callEvent(TimedRegisteredLi
    stener.java:30)
            at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.j
    ava:478)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
    ava:463)
            at org.bukkit.craftbukkit.v1_6_R3.event.CraftEventFactory.callEntityDeat
    hEvent(CraftEventFactory.java:344)
            at net.minecraft.server.v1_6_R3.EntityInsentient.dropDeathLoot(EntityIns
    entient.java:202)
            at net.minecraft.server.v1_6_R3.EntityLiving.die(EntityLiving.java:765)
            at net.minecraft.server.v1_6_R3.EntityLiving.damageEntity(EntityLiving.j
    ava:717)
            at net.minecraft.server.v1_6_R3.EntityMonster.damageEntity(EntityMonster
    .java:39)
            at net.minecraft.server.v1_6_R3.EntityZombie.damageEntity(EntityZombie.j
    ava:127)
            at net.minecraft.server.v1_6_R3.EntityHuman.attack(EntityHuman.java:890)
     
            at net.minecraft.server.v1_6_R3.PlayerConnection.a(PlayerConnection.java
    :1158)
            at net.minecraft.server.v1_6_R3.Packet7UseEntity.handle(Packet7UseEntity
    .java:25)
            at org.spigotmc.netty.NettyNetworkManager.b(NettyNetworkManager.java:237
    )
            at net.minecraft.server.v1_6_R3.PlayerConnection.e(PlayerConnection.java
    :117)
            at net.minecraft.server.v1_6_R3.ServerConnection.b(SourceFile:37)
            at org.spigotmc.netty.NettyServerConnection.b(NettyServerConnection.java
    :131)
            at net.minecraft.server.v1_6_R3.MinecraftServer.t(MinecraftServer.java:6
    04)
            at net.minecraft.server.v1_6_R3.DedicatedServer.t(DedicatedServer.java:2
    40)
            at net.minecraft.server.v1_6_R3.MinecraftServer.s(MinecraftServer.java:4
    93)
            at net.minecraft.server.v1_6_R3.MinecraftServer.run(MinecraftServer.java
    :425)
            at net.minecraft.server.v1_6_R3.ThreadServerApplication.run(SourceFile:5
    83)
    Caused by: java.lang.NullPointerException
            at io.github.sipsi133.KillCount.updateWeaponKillCount(KillCount.java:119
    )
            at io.github.sipsi133.KillCount.onEntityKill(KillCount.java:97)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
            at java.lang.reflect.Method.invoke(Unknown Source)
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
    va:425)
            ... 22 more
    >
    Line 119 is: if (lore.get(0).contains("Kills: ")) {
    Line 97 is: updateWeaponKillCount(weapon);
     
  8. Offline

    BillyGalbreath

    Ok, I fixed my code. I tested it on my server and it works fine. I've updated my post with the correct code in it on page 1. ;)
     
  9. Offline

    sipsi133

    BillyGalbreath Thank you! Is this working for players too?

    Is it hard for you to make two lores, one for Entity kills and one for ONLY player kills?
     
Thread Status:
Not open for further replies.

Share This Page