Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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 by Pandal

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.

  • 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 by Pandal

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.

  • 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..

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/

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.

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 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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.