Posted August 19, 20187 yr Hi. I'm trying to use this event, but it doens't work, i've tried solutions of different posts in this forum, but nothing. I don't know why but the function "onPlayerLogin" doesn't start... This is the function: EventHandler class: @EventBusSubscriber public class PandalEventHandler @SubscribeEvent public static void onPlayerLogin(PlayerEvent.PlayerLoggedInEvent event) Main MinecraftForge.EVENT_BUS.register(PandalEventHandler.class); PS: I'm testing it joining in my server, i need it client-side.. i think this event is client side, or not? Can someone help me? Edited August 19, 20187 yr by Pandal
August 19, 20187 yr 21 minutes ago, Pandal said: think this event is client side, or not? It is not client side, only server side. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
August 19, 20187 yr Author Ah. Is there any equivalent event to use client_side? I have to take only the player entity, nothing more. Or maybe i can use the ClientConnectedToServerEvent. Can i take player display name and the server ip using that? Edited August 19, 20187 yr by Pandal
August 19, 20187 yr 39 minutes ago, Pandal said: Can i take player display name and the server ip using that? Why not try it and see if it works? And I dont think there is any problem except maybe the player won't exist. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
August 19, 20187 yr Author I've already tried it. I changed to "PlayerLoggedInEvent" because of this; i saw other topic saying i can take playername and server ip using Minecraft.* but it doesn't work, i don't find usefull methods..
August 20, 20187 yr Also, even for server side I don't think you're registering it correctly. If your even handling method is static you should use the annotation method for subscribing (whole class annotated as an event bus subscriber) or you should remove the static modifier if you continue to register it directly like you're doing. Check out my tutorials here: http://jabelarminecraft.blogspot.com/
August 20, 20187 yr 5 hours ago, jabelar said: If your even handling method is static you should use the annotation method for subscribing (whole class annotated as an event bus subscriber) or you should remove the static modifier if you continue to register it directly like you're doing. You can register the class if your methods are static, though I agree the annotation is neater. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
August 21, 20187 yr I know your pain, what I use on the client instead is: But this also fires on dimension changes. It's useful at times, but should be used with care. @SubscribeEvent public static void onEvent(EntityJoinWorldEvent event) { if ((event.getEntity() instanceof EntityPlayer)) { } } Edited August 21, 20187 yr by Aeronica
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.