CC: Tweaked

CC: Tweaked

42M Downloads

Turtle does not attack.

cerealgrainhouse opened this issue ยท 2 comments

commented
  • MC: 1.16.1
  • CC-T: 1.90.1

calling turtle.attack() always returns "Nothing to attack here"

Steps to reproduce:
Spawn a mob infront of a turtle with a tool.
Call turtle.attack.
Mob will not get attacked and function returns false, "Nothing to attack here"

I tried it with forge 32.0.75 and 32.0.69, both don't work.
The same situation in 1.15 damages the mob and the function returns true.

commented

I don't know much about java or forge so sorry in advance.

Changing line 122 TurtleTool.java from:
Vector3d turtlePos = turtlePlayer.getPositionVec();
to:
Vector3d turtlePos = new Vector3d( position.getX(), position.getY(), position.getZ() );
seems to fix the issue as getPositionVec() always returned 0,0,0 in my testing.

I noticed that in forge's FakePlayer class getPositionVec() always returns 0,0,0 and I could not find an override of it in TurtlePlayer.

commented

That was exactly it, thank you! Turns out I'd removed the override in the initial upgrade, and forgotten to add it back.