I use this for Rotating a Custom Rendered Block
The Problem is now If I make it so like in the Example it only works on server (I know that its cause by @SideOnly)But I need a way to use EntityPlayer (Or something like that example: EntityPlayerMP) on the Client Side and on the Server Side
It's not working on the Server Side if I make
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
I would be really glad if you could help me with this.
Thanks in advance
Aside from that, just use the EntityPlayer you get from the method parameters, and don't cast it to EntityPlayerMP or EntityClientPlayerMP - there is almost never any reason to do so.
To do something on one side or the other, you can check if the world is remote ( = client side) or not ( = server side):
if (world.isRemote) {
// client
} else {
// server
}
[size=1em][font=monospace, serif][color=rgb(0, 0, 0)]EntityPlayer player = Minecraft.getMinecraft().thePlayer;
[/color][/font][/size]
[font=monospace, serif][color=rgb(0, 0, 0)][size=1em]and [/size]everything[size=1em] works event without the world.isRemote but still very big thanks its good to know that stuff[/size][/color][/font]
And I need EntityPlayerMP because EntityPlayer Crashes the Server and big thanks again
If using EntityPlayer crashed on the server, you are doing something else wrong (such as ClassCastException if the entity placing the block is not a player).
Post your crash log.
Edited the previous post with a link explaining about side only.
If using EntityPlayer crashed on the server, you are doing something else wrong (such as ClassCastException if the entity placing the block is not a player).
Right haven't think about That.
I used onBlockAdded event in the 1.7.10 version
and needed it there I will remove that and change the other parts of code also ^^
I have a Problem with EntityPlayer
Here is the Code for which I need it:
I use this for Rotating a Custom Rendered Block
The Problem is now If I make it so like in the Example it only works on server (I know that its cause by @SideOnly)But I need a way to use EntityPlayer (Or something like that example: EntityPlayerMP) on the Client Side and on the Server Side
It's not working on the Server Side if I make
I would be really glad if you could help me with this.
Thanks in advance
Oh and sorry for my bad English I am from Germany
Aside from that, just use the EntityPlayer you get from the method parameters, and don't cast it to EntityPlayerMP or EntityClientPlayerMP - there is almost never any reason to do so.
To do something on one side or the other, you can check if the world is remote ( = client side) or not ( = server side):
Edit: I don't believe how stupid I was :/
Just make it
[size=1em][font=monospace, serif][color=rgb(0, 0, 0)] [/color][/font][/size]
[size=1em][font=monospace, serif][color=rgb(0, 0, 0)]and not[/color][/font][/size]
[/color][/font][/size]
[font=monospace, serif][color=rgb(0, 0, 0)][size=1em]and [/size]everything[size=1em] works event without the world.isRemote but still very big thanks its good to know that stuff[/size][/color][/font]
If using EntityPlayer crashed on the server, you are doing something else wrong (such as ClassCastException if the entity placing the block is not a player).
Post your crash log.
Edited the previous post with a link explaining about side only.
Right haven't think about That.
I used onBlockAdded event in the 1.7.10 version
and needed it there I will remove that and change the other parts of code also ^^