Spigot StatisticEditor 1.4

Edit Spigot player statistics

  1. AlanZ submitted a new resource:

    StatisticEditor - Edit Spigot player statistics

    Read more about this resource...
     
  2. SlimeDog

    Moderator Patron

    Very nice offering.

    Feature requests:
    • Alphabetize tab-completion options.
    • Implement localization (ie., language file) with (internal) placeholders for the values, so messages can be customized consistent with server style. For example, I would format
      • {player} {statistic} {entity} = {value}
      • SlimeDog ENTITY_KILLED_BY ZOMBIE = 1
    • Implement PlaceholderAPI expansion, so values can be utilized on signs and etc.
    • Change parameter order: statistic <player> <statistic> ...
    • Implement statistic <player> ALL to display all values (alphabetized list, of course).
     
    #2 SlimeDog, Feb 28, 2020
    Last edited: Feb 28, 2020
    • Agree Agree x 1
  3. The tab-completion options were alphabetized when I was testing it, not sure why they weren't for you. I'll look at it a little more.
    Ok
    Never tried that before, guess it'll be a learning experience :)
    Yeah, the order was originally so you could implicitly get and set your own statistics but it got a little too complicated that way, and I never changed the usage back. I'll do that.
    Good idea, I'll work on that.

    Thanks for your feedback!
     
    • Agree Agree x 1
    • Friendly Friendly x 1
  4. SlimeDog

    Moderator Patron

    Spigot 1.15.2
    Statistic 1.0
    At the console:
    Code (Text):
    >statistic <tab>
    DAMAGE_DEALT                      DAMAGE_TAKEN                      DEATHS                            MOB_KILLS                      
    PLAYER_KILLS                      FISH_CAUGHT                       ANIMALS_BRED                      LEAVE_GAME                      
    JUMP                              DROP_COUNT                        DROP                              PICKUP                          
    PLAY_ONE_MINUTE                   WALK_ONE_CM                       WALK_ON_WATER_ONE_CM              FALL_ONE_CM                    
    SNEAK_TIME                        CLIMB_ONE_CM                      FLY_ONE_CM                        WALK_UNDER_WATER_ONE_CM        
    MINECART_ONE_CM                   BOAT_ONE_CM                       PIG_ONE_CM                        HORSE_ONE_CM                    
    SPRINT_ONE_CM                     CROUCH_ONE_CM                     AVIATE_ONE_CM                     MINE_BLOCK                      
    USE_ITEM                          BREAK_ITEM                        CRAFT_ITEM                        KILL_ENTITY                    
    ENTITY_KILLED_BY                  TIME_SINCE_DEATH                  TALKED_TO_VILLAGER                TRADED_WITH_VILLAGER            
    CAKE_SLICES_EATEN                 CAULDRON_FILLED                   CAULDRON_USED                     ARMOR_CLEANED                  
    BANNER_CLEANED                    BREWINGSTAND_INTERACTION          BEACON_INTERACTION                DROPPER_INSPECTED              
    HOPPER_INSPECTED                  DISPENSER_INSPECTED               NOTEBLOCK_PLAYED                  NOTEBLOCK_TUNED                
    FLOWER_POTTED                     TRAPPED_CHEST_TRIGGERED           ENDERCHEST_OPENED                 ITEM_ENCHANTED                  
    RECORD_PLAYED                     FURNACE_INTERACTION               CRAFTING_TABLE_INTERACTION        CHEST_OPENED                    
    SLEEP_IN_BED                      SHULKER_BOX_OPENED                TIME_SINCE_REST                   SWIM_ONE_CM                    
    DAMAGE_DEALT_ABSORBED             DAMAGE_DEALT_RESISTED             DAMAGE_BLOCKED_BY_SHIELD          DAMAGE_ABSORBED                
    DAMAGE_RESISTED                   CLEAN_SHULKER_BOX                 OPEN_BARREL                       INTERACT_WITH_BLAST_FURNACE    
    INTERACT_WITH_SMOKER              INTERACT_WITH_LECTERN             INTERACT_WITH_CAMPFIRE            INTERACT_WITH_CARTOGRAPHY_TABLE
    INTERACT_WITH_LOOM                INTERACT_WITH_STONECUTTER         BELL_RING                         RAID_TRIGGER                    
    RAID_WIN                          INTERACT_WITH_ANVIL               INTERACT_WITH_GRINDSTONE
     
  5. SlimeDog

    Moderator Patron

    Feature request:
    • Please add a command alias stats (in plugin.yml). I know it's only four fewer keystrokes, but it just feels more natural.
    • Permit operations for offline players.
     
    #5 SlimeDog, Feb 28, 2020
    Last edited: Feb 28, 2020
    • Agree Agree x 1
  6. Ah yeah, good idea.
    I did think about this one, but as far as I can tell there isn't a way to use statistics with offline players, the only methods I could find are under the Player class. It would be doable but it would require messing with the JSON stats file in the world directory. I'll look into it.
     
  7. SlimeDog

    Moderator Patron

    Hmmm. That's what I do now, with a text editor. :)

    That just seems wrong (not you, but Mojang). Messing with the json seems like too much. Let me dig a little.
     
  8. It looks like it's a console thing, explicitly sorting and printing the tab completion results confirms they are sorted correctly but they aren't sorted in the console. Not sure how to fix that.
     
  9. SlimeDog

    Moderator Patron

    Maybe it's the multicolumn output. Just a thought...
     
  10. I was just about to come in here to recommend a feature to reset all players on a certain value. Looks like someone beat me to it! (And also recommended some other great suggestions as well!)
     
    • Friendly Friendly x 1
  11. Oh! How about an option to edit offline players values?
     
  12. SlimeDog

    Moderator Patron

    Please read back. :)
     
  13. Ahhh!! You beat me to it again! :ROFLMAO: Hahah nice job.

    I think this plugin has a lot of potential to be very in-demand. So good luck AlanZ!
     
    • Agree Agree x 1
    • Friendly Friendly x 1
  14. SlimeDog

    Moderator Patron

    Thanks for all that! And fast!
     
  15. SlimeDog

    Moderator Patron

    stats <player> ALL
    is nice, but if stat requires a parameter then (for example)
    Feature request:
    • Option to iterate through the values of a statistic. Perhaps (same example): stats <player> ENTITY_KILLED_BY ALL
    • Option to iterate through the values of all statistics. Perhaps: stats <player> ALL ALL
     
  16. Seems doable, but it could get a bit spammy for stats that require material arguments.
    Seems like that would be a lot of output really fast, there are 6 statistics with material arguments, and there are a few hundred (?) materials, that's quite a bit of information. I suppose you could filter by ones with values, but with any amount of play time that's still a lot.
     
    • Agree Agree x 1
    • Like Like x 1
  17. SlimeDog

    Moderator Patron

    Spigot 1.15.2
    StatisticEditor 1.2

    Nice, but ALL still includes a lot of zeros
    Code (Text):
    >stats SlimeDog ALL
    [14:18:57] [Server thread/INFO]: ANIMALS_BRED: 0
    [14:18:57] [Server thread/INFO]: ARMOR_CLEANED: 0
    [14:18:57] [Server thread/INFO]: AVIATE_ONE_CM: 842
    [14:18:57] [Server thread/INFO]: BANNER_CLEANED: 0
    [14:18:57] [Server thread/INFO]: BEACON_INTERACTION: 0
    [14:18:57] [Server thread/INFO]: BELL_RING: 0
    [14:18:57] [Server thread/INFO]: BOAT_ONE_CM: 276976
    [14:18:57] [Server thread/INFO]: BREAK_ITEM: requires ITEM parameter
    [14:18:57] [Server thread/INFO]: BREWINGSTAND_INTERACTION: 0
    [14:18:57] [Server thread/INFO]: CAKE_SLICES_EATEN: 74
    [14:18:57] [Server thread/INFO]: CAULDRON_FILLED: 59
    [14:18:57] [Server thread/INFO]: CAULDRON_USED: 0
    [14:18:57] [Server thread/INFO]: CHEST_OPENED: 385
    [14:18:57] [Server thread/INFO]: CLEAN_SHULKER_BOX: 0
    [14:18:57] [Server thread/INFO]: CLIMB_ONE_CM: 92982
    [14:18:57] [Server thread/INFO]: CRAFTING_TABLE_INTERACTION: 24
    [14:18:57] [Server thread/INFO]: CRAFT_ITEM: requires ITEM parameter
    [14:18:57] [Server thread/INFO]: CROUCH_ONE_CM: 30352
    [14:18:57] [Server thread/INFO]: DAMAGE_ABSORBED: 0
    [14:18:57] [Server thread/INFO]: DAMAGE_BLOCKED_BY_SHIELD: 0
    [14:18:57] [Server thread/INFO]: DAMAGE_DEALT: 15848
    [14:18:57] [Server thread/INFO]: DAMAGE_DEALT_ABSORBED: 0
    [14:18:57] [Server thread/INFO]: DAMAGE_DEALT_RESISTED: 0
    [14:18:57] [Server thread/INFO]: DAMAGE_RESISTED: 0
    [14:18:57] [Server thread/INFO]: DAMAGE_TAKEN: 13066
    [14:18:57] [Server thread/INFO]: DEATHS: 8
    [14:18:57] [Server thread/INFO]: DISPENSER_INSPECTED: 0
    [14:18:57] [Server thread/INFO]: DROP: requires ITEM parameter
    [14:18:57] [Server thread/INFO]: DROPPER_INSPECTED: 0
    [14:18:57] [Server thread/INFO]: DROP_COUNT: 62
    [14:18:57] [Server thread/INFO]: ENDERCHEST_OPENED: 1
    [14:18:57] [Server thread/INFO]: ENTITY_KILLED_BY: requires ENTITY parameter
    [14:18:57] [Server thread/INFO]: FALL_ONE_CM: 122851
    [14:18:57] [Server thread/INFO]: FISH_CAUGHT: 0
    [14:18:57] [Server thread/INFO]: FLOWER_POTTED: 23
    [14:18:57] [Server thread/INFO]: FLY_ONE_CM: 55405185
    [14:18:57] [Server thread/INFO]: FURNACE_INTERACTION: 98
    [14:18:57] [Server thread/INFO]: HOPPER_INSPECTED: 13
    [14:18:57] [Server thread/INFO]: HORSE_ONE_CM: 69638
    [14:18:57] [Server thread/INFO]: INTERACT_WITH_ANVIL: 1
    [14:18:57] [Server thread/INFO]: INTERACT_WITH_BLAST_FURNACE: 0
    [14:18:57] [Server thread/INFO]: INTERACT_WITH_CAMPFIRE: 0
    [14:18:57] [Server thread/INFO]: INTERACT_WITH_CARTOGRAPHY_TABLE: 0
    [14:18:57] [Server thread/INFO]: INTERACT_WITH_GRINDSTONE: 0
    [14:18:57] [Server thread/INFO]: INTERACT_WITH_LECTERN: 32
    [14:18:57] [Server thread/INFO]: INTERACT_WITH_LOOM: 9
    [14:18:57] [Server thread/INFO]: INTERACT_WITH_SMOKER: 0
    [14:18:57] [Server thread/INFO]: INTERACT_WITH_STONECUTTER: 0
    [14:18:57] [Server thread/INFO]: ITEM_ENCHANTED: 0
    [14:18:57] [Server thread/INFO]: JUMP: 8406
    [14:18:57] [Server thread/INFO]: KILL_ENTITY: requires ENTITY parameter
    [14:18:57] [Server thread/INFO]: LEAVE_GAME: 1215
    [14:18:57] [Server thread/INFO]: MINECART_ONE_CM: 48247
    [14:18:57] [Server thread/INFO]: MINE_BLOCK: requires BLOCK parameter
    [14:18:57] [Server thread/INFO]: MOB_KILLS: 127
    [14:18:57] [Server thread/INFO]: NOTEBLOCK_PLAYED: 8
    [14:18:57] [Server thread/INFO]: NOTEBLOCK_TUNED: 46
    [14:18:57] [Server thread/INFO]: OPEN_BARREL: 18
    [14:18:57] [Server thread/INFO]: PICKUP: requires ITEM parameter
    [14:18:57] [Server thread/INFO]: PIG_ONE_CM: 0
    [14:18:57] [Server thread/INFO]: PLAYER_KILLS: 0
    [14:18:57] [Server thread/INFO]: PLAY_ONE_MINUTE: 87753047
    [14:18:57] [Server thread/INFO]: RAID_TRIGGER: 0
    [14:18:57] [Server thread/INFO]: RAID_WIN: 0
    [14:18:57] [Server thread/INFO]: RECORD_PLAYED: 0
    [14:18:57] [Server thread/INFO]: SHULKER_BOX_OPENED: 13
    [14:18:57] [Server thread/INFO]: SLEEP_IN_BED: 16
    [14:18:57] [Server thread/INFO]: SNEAK_TIME: 216195
    [14:18:57] [Server thread/INFO]: SPRINT_ONE_CM: 1269172
    [14:18:57] [Server thread/INFO]: SWIM_ONE_CM: 3415
    [14:18:57] [Server thread/INFO]: TALKED_TO_VILLAGER: 13
    [14:18:57] [Server thread/INFO]: TIME_SINCE_DEATH: 9363019
    [14:18:57] [Server thread/INFO]: TIME_SINCE_REST: 507
    [14:18:57] [Server thread/INFO]: TRADED_WITH_VILLAGER: 0
    [14:18:57] [Server thread/INFO]: TRAPPED_CHEST_TRIGGERED: 40
    [14:18:57] [Server thread/INFO]: USE_ITEM: requires ITEM parameter
    [14:18:57] [Server thread/INFO]: WALK_ONE_CM: 30239569
    [14:18:57] [Server thread/INFO]: WALK_ON_WATER_ONE_CM: 222154
    [14:18:57] [Server thread/INFO]: WALK_UNDER_WATER_ONE_CM: 743098

    And ALL doesn't work as a subcategory, although it is included in tab-completion
    Code (Text):
    >stats SlimeDog ENTITY_KILLED_BY ALL
    [14:23:38] [Server thread/WARN]: Unexpected exception while parsing console command "stats rambeau ENTITY_KILLED_BY ALL"
    org.bukkit.command.CommandException: Unhandled exception executing command 'stats' in plugin StatisticEditor v1.2
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[spigot-1.15.2.jar-2020-03-05-2123:git-Spigot-8faa8b4-7f61a25]
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:149) ~[spigot-1.15.2.jar-2020-03-05-2123:git-Spigot-8faa8b4-7f61a25]
            at org.bukkit.craftbukkit.v1_15_R1.CraftServer.dispatchCommand(CraftServer.java:713) ~[spigot-1.15.2.jar-2020-03-05-2123:git-Spigot-8faa8b4-7f61a25]
            at org.bukkit.craftbukkit.v1_15_R1.CraftServer.dispatchServerCommand(CraftServer.java:698) [spigot-1.15.2.jar-2020-03-05-2123:git-Spigot-8faa8b4-7f61a25]
            at net.minecraft.server.v1_15_R1.DedicatedServer.handleCommandQueue(DedicatedServer.java:443) [spigot-1.15.2.jar-2020-03-05-2123:git-Spigot-8faa8b4-7f61a25]
            at net.minecraft.server.v1_15_R1.DedicatedServer.b(DedicatedServer.java:407) [spigot-1.15.2.jar-2020-03-05-2123:git-Spigot-8faa8b4-7f61a25]
            at net.minecraft.server.v1_15_R1.MinecraftServer.a(MinecraftServer.java:984) [spigot-1.15.2.jar-2020-03-05-2123:git-Spigot-8faa8b4-7f61a25]
            at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:824) [spigot-1.15.2.jar-2020-03-05-2123:git-Spigot-8faa8b4-7f61a25]
            at java.lang.Thread.run(Thread.java:834) [?:?]
    Caused by: java.lang.IllegalArgumentException: The supplied EntityType does not have a corresponding statistic
            at org.apache.commons.lang.Validate.notNull(Validate.java:192) ~[spigot-1.15.2.jar-2020-03-05-2123:git-Spigot-8faa8b4-7f61a25]
            at org.bukkit.craftbukkit.v1_15_R1.entity.CraftPlayer.getStatistic(CraftPlayer.java:821) ~[spigot-1.15.2.jar-2020-03-05-2123:git-Spigot-8faa8b4-7f61a25]
            at me.AlanZ.StatisticEditor.StatisticManager.setStatValue(StatisticManager.java:37) ~[?:?]
            at me.AlanZ.StatisticEditor.StatisticManager.getStatValue(StatisticManager.java:11) ~[?:?]
            at me.AlanZ.StatisticEditor.StatisticCommand.onCommand(StatisticCommand.java:61) ~[?:?]
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[spigot-1.15.2.jar-2020-03-05-2123:git-Spigot-8faa8b4-7f61a25]
            ... 8 more
     
  18. That wasn't unintentional, (although not intentional either,) that way it appears like the minecraft statistics screen which also displays stats that are just zeroes. If zeroless output is more user-friendly I could change it.
    Hmm, yeah I forgot to test the entity stats apparently, although the material ones still work. It was caused because there is an EntityType.UNKNOWN that doesn't have stats associated with it because it's not real. A fix is on the way.
     
    • Friendly Friendly x 1