Minecraft RPG
- 6 Devlogs
- 9 Total hours
I've always thought that RPG plugins for minecraft suck, so why not build my own! This is way too much work for me pray for me yall
I've always thought that RPG plugins for minecraft suck, so why not build my own! This is way too much work for me pray for me yall
Fixed! Turns out gson was trying to serialize the entire references to the bukkit config file, as well as the runnable listener (which is being used to detect level ups), which caused some nasty circular reference issues. (the json files ended up being almost 8mb before I fixed it!)
Edit: I forgot to click post, but since writing the original part above I managed to get a working mana display above the hotbar, and the wands now use mana. In doing so I broke player loading, and I also need to figure out a better way to store mana stats, since if I make the entire mana class transient then the player’s max mana will also be transient.
All i had to do to fix was add the transient keyword to the fields that were causing issues.
The wands are roughly implemented now; I’ve attached a picture of a custom item (a wand) that summons lightning where the player is looking. Unfortunately I’ve been running into some issues with saving a user’s profile, and have been trying to debug them for a while now. As far as I’m aware I haven’t changed anything with the saving so I’m a bit lost right now! Hopefully I get things all sorted out
I moved away temporarily from the stat system and worked on custom items. I now have an abstract class for custom items, and a CustomItemsManager class that makes it easier to access and get the items. The only current implementation is an wand that overrides the playerinteract event and sends the player a message when they do so. I also added a command /rpgget so I can easily get and test custom items.
Next, I want to extend the AbstractItem class to have some custom items have stats.
The leveling system now works. You can run /level to view your level, and when you reach enough level an event will be fired, and an event listener will run, sending a message to the player. Getting the custom events and listeners was the biggest pain, but I eventually decided on creating a StatChange event which runs whenever a stat is changed, and then the PlayerStatChange which extends StatChange while adding access to a player profile.
I also had add a method to calculate level based off of XP.
ALSO I finally uploaded to github! https://github.com/Mikeymoo5/MinecraftRPG/
I fleshed out the statmanager and player profile system. The player’s profile and custom data is now loaded when the player joins, from file (unless the user is new, in which case new data is made), and saved to file when the user leaves. I’m using GSON to save the player data. The attached image shows how a file is named after a player UUID, and how it stores player data.
Began work on the plugin. Added a basic command as well as an abstract Stat class. I also started working on a level class that implements the stat class as well as starting to actually manage stats on a player.