Nightstag
-
Posts
12 -
Joined
-
Last visited
Posts posted by Nightstag
-
-
I'd use a tick handler, not sure which one, though. I would assume server, though, correct?
(Of course I would use an if inside of the method)
-
Suppose I was running it without using keys, how would I do it?
-
You sure? I did it with onUpdate before in a class that extends Item without packets.
-
It's triggered by a keystroke in onPlayerTick.
-
I'm trying to call it within a method:
public void roll(Player player) { player.motionX = 10; }
I just need to know what to put in the parameter for player when I'm referencing it.
-
OK, basically, I need to change the player's motionX and motionY. How do I do this?
-
Basically, I need to access an instance of player to change motionX, motionY, etc. How would I reference the main, or the being controlled instance of Player?
-
I was trying to use it for calling a method when a key is pressed, (or just running it in onUpdate, whatever) and I chose onUpdate because it had, in the past I think, a parameter for the player. (Whick a tickhandler does not have/support, afaik)
-
So I'm just supposed to do
@Override public void onUpdate() { }
I think I'm misinterpreting you.
-
onUpdate is a method in Entity. It takes no parameters.
Are you sure...? I'm pretty sure I've used parameters with it in the past. Maybe I'm misunderstanding what you mean by parameters?
-
So I'm attempting to use the onUpdate method, which, of course, requires @Override. However, I get an error stating that I need to override or implement a supertype method. So, of course, I type
super.onUpdate(itemstack, world, player, par1, par2);
I then get another error, stating that this method (onUpdate(ItemStack, Entity, int, boolean)) is undefined for the type object. Am I using the wrong parameters, or do I need to implement something else? Thanks.
Referencing instance of Player
in Modder Support
Posted
My main question is what instance of player do I refer to to change motionX and motionY. I still need to know that to finish.