Posted September 3, 20178 yr So I've been kinda stuck with this event with casting. event.player returns an instance of EntityPlayer, but I need EntityPlayerMP to give the player some recipes. If I cast it to EntityPlayerSP or EntityPlayerMP, it throws ClassCastException (casting it to 'MP crashes Minecraft). Is there any way I can get instances of EntityPlayerSP and EntityPlayerMP or is there a way to check on which side the code is run? Edited September 3, 20178 yr by TheTrollguy_
September 3, 20178 yr this checks which side the code is on. this answers part of your question world.isRemote is false if server world if (!world.isRemote) { }
September 3, 20178 yr Author 37 minutes ago, That_Martin_Guy said: Can't you just check what type the EntityPlayer is with instanceof? I totally forgot about using instanceof . Thank you! Problem fixed. I'll see myself out now....
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.