Better Statistics Screen

Better Statistics Screen

21M Downloads

Developer API

Roundaround opened this issue ยท 3 comments

commented

Hello! I am the developer of the More Stats mod, and have been toying with what else I can add to the list of stats. However, I'm blocked by the fact that the vanilla UI is not so great (hence your mod here!). I would love it if there was a way that I could utilize what you've created to surface more tracked statistics!

In particular, I'm looking to:

  • Show more entries in the "mobs" tab, like damage done to/by each mob, and how many times a mob caused a totem to pop
  • (Same for items)
  • Create additional tabs for additional stat categories or tracking systems

Please let me know if such an integration is possible!

commented

Hello again!
It's been a while since this issue was first opened, but as of recently, I've been leaning more and more towards supporting modded features, including stats.

I recently published v3.9 on GitHub, with CurseForge and Modrinth soon to follow. The primary goal with this release is more support for modded stats, and your More Stats mod will hopefully be more accessible via betterstats as well.

There's only one tiny issue with how Minecraft works, that being how Minecraft is handling entity StatType texts. For example:

  • Displaying You have killed %s %s instead of Killed: %d, or for example
  • Displaying %s killed you %s times instead of Died to: %d

As such, this mod would need something as advanced as an AI LLM if it ever wanted to display modded entity StatTypes, as they follow a similar text format. Aka, it's impossible to tell which %s to replace with the entity name, and which %s to replace with the stat value number.

To tackle this issue, I did implement an API thingy in this mod, allowing mod developers to define their own "text formatters" for mob stats, so that this mod actually has a way to format modded mob stats into human-readable text. If you're ever interested, you can have a look at the BSRegistries class in my API. And you can also use CurseMaven to add my mod to your gradle project.

  • More specificially, you're looking for ENTITY_STAT_TEXT_FORMATTER and ENTITY_STAT_PHRASE. In the script, I included JavaDoc comments on how they work.

So yeah, if you're ever interested, there is an API that could help you out now. If you ever wanna use it and need help using it, feel free to ask me anything. In the meantime, I wanna try and explore any possible solutions to takle the "language barrier" issue I mentioned, if it's even possible to tackle it.
Have a great day again!

commented

Hello. Thank you the suggestion and for taking interest in integrating my mod. I feel like such integration is possible, so I would love to help you out with it.

Altho I am thinking about what the best way to do it would be. Perhaps I should first publish the mod onto Maven as a library that you can then add to your project as a compile-time dependency. I would also have to do the same for TCDCommons. as this mod depends on it (the main thing TCDCommons has as of right now is GUI libraries and utilities).

After that I am thinking maybe the best way of integrating would be for me to write some sort of API that allows you or anyone else to add extra features. For example I could create an API that has "hooks" in it that allow you or anyone else to do something when something else in the mod takes place. Like for example, when the user clicks on the tab selection button, the API could give you an instance of that button's dropdown menu, allowing you to append your own options, and so on.. As for other things, We can figure those out as well.

So I do believe it can be done. Altho, I just wanna mention I will be a bit mory busy than usual today, so apologies if I respond late. The first thing I will have to do is figure out how Maven publishing works tho, as this would be my first time doing it.

Thanks again for the suggestion, and have a great day.

commented

v3.0 is gonna be ready soon hopefully, and will feature an API for developers. As such, I will close the issue as "Planned", so I don't forget to later.