Today I spent around two hours working on a new feature for Caesar, my Minecraft staff plugin: Staff Mode.
The idea is simple: when a staff member runs /staffmode, the plugin saves their current inventory, armor, location, and gamemode.
Then it clears their inventory, puts them in creative mode, gives them vanish, and lets them do staff stuff without affecting their normal survival items.
At first I tried saving the inventory directly into a YAML file, but restoring it was not working properly. The data was there, but the player was not getting their items back correctly.
After debugging it for a while, I changed the system to serialize the inventory into a Base64 string. This makes the saved data easier to store and much more reliable to restore later.
Now, when the player exits Staff Mode, Caesar reads the saved data, restores the inventory and armor, teleports the player back, restores their gamemode, disables vanish, and cleans the saved data from the file.
This was not a huge feature, but it was a good learning experience.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.