Jump to content

Need help with detecting when a player joins a world.


NightFox

Recommended Posts

So I'm trying to make the player get 2 apples when joining a world (for testing purposes) but I cant seem to get it to work. here's my code:

    @SubscribeEvent
    public static void init(FMLInitializationEvent event)
    {
    	MinecraftForge.EVENT_BUS.register(EventHandler.class);
    }
    @SubscribeEvent
    public static void PlayerLoggedInEvent(EntityPlayer player)
    {
    	player.inventory.addItemStackToInventory(new ItemStack(Items.apple, 2));
        player.addChatMessage(new ChatComponentText("test"));
    }

 

Link to comment
Share on other sites

  • Guest locked this topic
Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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