I would like to make a beastmaster mod. Adds a lot of tameable and mountable mobs and I need a gui that when opened shows all the players that joined the server and set how much you trust that player. Back in the day someone killed all of our pets. They are way stronger than the players gear but they didn't fight back because they were tamed, and i don't want to resort the code to the vanilla scenario "hit your friend accidentally once and all of his 60+ tamed wolves start chasing you and you don't wanna kill any of them because they're all cute and your friend will hate you". So I need a system for choosing your friends from your enemy for your pets to trust.
There are 4 trust levels for a player:
1. Enemy - Pets will kill him on sight to prevent them from hurting the player.
2. Stranger(Default) - Pets will be wary but if the player attacked them or their owner too much, set to enemy then DEFEND THE MASTER! RIP AND TEAR! BLOOD FOR THE BLOOD GOD!
3. Friend - Cast on trusted people Pets will not attack if accidentally punched or stabbed for a few times but with a mathematical algorithm that weighs how many times he attacked and dealt damage in a time, set him to Enemy Mode for pets to retaliate (Ill make my own algorithm for this, if is it too resource heavy for a server visited by 30,000 players at least once, warn me not to preventing lag). If a pet can mount multiple players, only allow the the player to the other seats not the first passenger index (controller)!
4. Best Friend - Same as friend but the player can become the controller (Necessary when you need to get out of a sticky situation and that friend was the first to ride and you were too slow)
What I understand:
1. Make an enum for the trust level. Enemy, Stranger, Friend, Best Friend
2. Collect all the player UUIDs using the Collections class or ArrayList and set it's enum state
3. Send those UUID to client(GUI).
4. Synchronize the enum with MessagePackets from client(GUI) to server.
What I don't understand:
1. How to connect it with the world data. Do I have to extend/implement a class, or call an Event?
2. How do I store the data in the world?
3. Should I use Collections or ArrayList? What's the difference, should I use a different class instead?
4. How do I make a stored data outside the world data called "Recent Players", "Enemy Players" , "Best Friend Players". If a player for example hates a lot of players in a server and goes to another server, he can easily navigate these tabs and simply set them all to enemy and friend status without manually scrolling for thousands of players.
5. When a Friend player mounts a multiple passenger mob, how do I set it to ride except the driver without a Nullpointer . Is simply +1 his passenger index enough?
6. How to open a Gui by pressing a button or clicking a button in the player's inventory.
PS: IS MY ENGLISH GOOD ENOUGH?