Jump to content

A PlayerLoggedInEvent problem


yhflab

Recommended Posts

package yhf_INITIAL;

import net.minecraftforge.common.MinecraftForge;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent;


@Mod(modid =yhf_INITIAL.MODID, name= yhf_INITIAL.NAME, version= yhf_INITIAL.VERSION)
public class yhf_INITIAL {

@SidedProxy(clientSide = "yhf_INITIAL.clientproxy", serverSide = "yhf_INITIAL.serverproxy")

public static serverproxy proxy;

public static final String MODID="YHF_INITIAL";
public static final String NAME="YHF_INITIAL";
public static final String VERSION="v1.0";
@SubscribeEvent
    public void checkUpdate(FMLInitializationEvent event)
    {
	FMLCommonHandler.instance().bus().register(new SKCCore());
    }
}

package yhf_INITIAL;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraftforge.common.MinecraftForge;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent;
public class SKCCore {
@SubscribeEvent
public void onPlayerLogin(PlayerEvent.PlayerLoggedInEvent event)
{
	int haha = 11;
	EntityPlayerMP player_MP = (EntityPlayerMP)event.player;
	player_MP.setPositionAndUpdate(769, 105, 283);
}


}

I know it includes some mistakes, but i have no ideas about how it works.

How to fix it?

Thanks a lot!

Link to comment
Share on other sites

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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