Started by
LueLusten
on
Topic category: Help with MCreator software
Hey everyone I know this was fixed by someone but I don't remeber who
I have ore what is not server friendly because of
EntityPlayer entity = Minecraft.getMinecraft().thePlayer;
This is a client side command and brakes servers, I know a few have fixed this, so how do we call the payer entity for
the ore to work
it was also included in onBlockAdd but then not used so I removed it there, so there a nother code I can wrap this in to fix it for servers or away to change entity call?
I need it too D:
@#1 Do you have discord?
@#1.1 Yes why?
@#1.1.1 Just wondering.
Who does not have discord this day and age lol but we have not fix yet unless you do :)
Quite simply , using this method you can not get reference to the actual player that has broken the block , I mean you can make a guess who could if you would iterate through player list and then check which one is the closest one to the block , but it would not be accurate in situation when for example more players would be near the same block.
So as you can see Block#onBlockDestroyedByPlayer() is called generally when the block is destroyed by a player , nothing less, nothing more.
If you want for some reason (like determining the action on player's inventory or apply some NBT depending on the player to the drop), there are many places where could you do this. You can use events or some alternatives even in the block itself.
However, I have to ask one thing, why on the Earth you need so much a reference to the player that has mined the block?
You are just creating a randomly sized explosion whenever it is mined. You do not apparently need the player here. And unless you don't plan need it for something, just get rid of the EntityPlayerSP reference.
How can i make a attack with a potion effect
@#4 ... are you new to a forum?
@Kane yes
@#5 welcome to the fourms then! :D
anyways, what do you mean by attack with a potion effect? if you mean in minecraft,
get a potion, drink it and attack,
@#5 Welcome but create a new topic, don't ask something new in here D: and I will answer
@OlieGamerTV thanks
and i was thinking about mcreactor (how to give my mob a attack with a potion effect)
I 100% didn't see this post get updated Woops, I never added all the player called it added them all on its bill, MCreator loves to add local/SP only code and put everything out of wack, I trying to learn how to mix match forge code and fix MCreators code but the tool goes out of it's way to edit things back alot.
I think I fixed the ore at one point but since custom blocks and mobs are not server friendly from MCreator I ditched the need for the ore we changed it to a more server friendly plant.