Closed mcqwy closed 4 years ago
There isn't currently an easy way to do this. If you make a PR adding an event, I'll merge it and make a build.
On Tue, Jul 28, 2020, 6:06 AM Mon_lh notifications@github.com wrote:
Hello, how can I use the clanapi to get the event of player entering town? Leave town and enter wilderness with players?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/The-Fireplace-Minecraft-Mods/Clans/issues/233, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABND5LHPAXKLFZTY7EAB6Y3R52WLDANCNFSM4PKMZFAA .
Hi! I spent some time defining a few events. First create event class' ClanModEvent.java ' ClanModEvent.java.txt
on stay 'Clans.java' register
Register in public void init(FMLInitializationEvent event)
method
new ClanModEvent();
You can publish any custom events to forge through forge method, and others can handle things directly by listening to events when developing attached mod.
Example of publishing event: MinecraftForge.EVENT_BUS.post(event);
Calling methods and publishing events. There are players forming a new raid team event. CommandJoinRaid.java.txt
Start the raid Event. CommandStartRaid.java.txt
End Raid Event. RaidingParties.java.txt
handleTerritoryChangedMessageEvent. TimerLogic.java.txt
The above are some of the events and ideas I provided. More custom events you can refer to my ideas to write code. The above code I only tested part of the event, maybe there will be bugs, maybe there will be a better place to write. You can change it as you like.
Hello, how can I use the clanapi to get the event of player entering town? Events after a player leaves town and enters the wilderness Players join the raid event A raid on an impending event