June 7, 20169 yr Google Forge Events. Use PlayerLoggedInEvent. Note: this event is fired only by server thread. More about sides: http://mcforge.readthedocs.io/en/latest/concepts/sides/ 1.7.10 is no longer supported by forge, you are on your own.
June 7, 20169 yr What exactly do you want to "log"? Do you want to store who entered in a server in a given time (lets say for a block that does X thing) or simply catch the event so that you can do something based on a player's entry in the game? In both you should look at forge events and event handling, these link should help you http://jabelarminecraft.blogspot.ca/p/minecraft-forge-172-event-handling.html http://bedrockminer.jimdo.com/modding-tutorials/advanced-modding/event-handler/ http://minecraftforgetutorials.weebly.com/event-introduction.html And the best tutorial imo: http://greyminecraftcoder.blogspot.ca/2013/12/forge-techniques-events.html When they say your code doesn't follow convention but ur edgy so u dont care d-d-d-dab on them haterz
June 7, 20169 yr Author I want to log and save a list: players joined the server inside log file: MC username, and time they joined, and how many have joined
June 7, 20169 yr I want to log and save a list: players joined the server inside log file: MC username, and time they joined, and how many have joined Note that PlayerLoggedInEvent has the joined player as public field. 1. MC username: player.getDisplayName() 2. Time they joined: I'd assume that you know how to get system time. To get minecraft time, use World#getWorldTime(). (Player has public field named worldObj) Get the Overworld using MinecraftServer#getEntityWorld() to get universal server time. 3. How many players have joined: - length of World#playerEntities for players in the world. - MinecraftServer#getCurrentPlayerCount() for all players in the server. And what do you mean (EDIT) by saving the list? I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP) II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.