The Twilight Forest

The Twilight Forest

143M Downloads

Naga speed NBT change

ShyNieke opened this issue ยท 4 comments

commented

Forge version: forge-14.23.5.2831
Twilight Forest version: 1.12.2-3.8.689

Steps to reproduce:

  1. have a naga in the world
  2. use the /entitydata command to change the naga's speed
  3. The naga's speed does not get changed

What I expected to happen:
the ability to change the naga's speed by modefying it's entitydata

What happened instead:
nothing at all sadly

commented

Yeah I need to move all of our bosses to use the attribute system for various AIs and they currently do not. It's on my todo list but I should make an actual ticket for this.

commented
commented

Given that the naga is a multipart entity, I think it might be a more complicated matter than just using entitydata to modify its speed, I'm afraid.

commented

So, looking into the code, perhaps this might have something to do with setSegmentsPerHealth, which calculates a new speed and then applies that as the base value depending on the number of segments?

		if (!world.isRemote) {
			double newSpeed = DEFAULT_SPEED - newSegments * (-0.2F / 12F);
			if (newSpeed < 0)
				newSpeed = 0;
			this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(newSpeed);
		}