water creatures speed not changing

Started by UtahPlaysYT on Sun, 05/24/2020 - 16:30

Topic category: Troubleshooting, bugs, and solutions

Last seen on 11:23, 9. Jan 2021
Joined Jul 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
water creatures speed not changing
Sun, 05/24/2020 - 16:30

When i make a water mob for my mod there speed are not changing is this happening to anyone else if not is there a way to change it so you can increase there speed?

Last seen on 22:23, 24. Jul 2021
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
That is working as intended…
Sun, 05/24/2020 - 16:34

That is working as intended because it is only went for land entities. However, there is a way you can make them go faster: give the entity the Dolphin’s Grace effect. But this will not work with bedrock Add-Ons because Bedrock does not have Dolphin’s Grace.

Last seen on 11:23, 9. Jan 2021
Joined Jul 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
ok thanks for the help :)  
Sun, 05/24/2020 - 16:42

ok thanks for the help :)

 

Last seen on 19:53, 2. Jun 2021
Joined Sep 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
like this?   public void…
Sat, 06/27/2020 - 22:49

like this?

 

public void tick() {
					if (CustomEntity.this.areEyesInFluid(FluidTags.WATER))
						CustomEntity.this.setMotion(CustomEntity.this.getMotion().add(0, 0.005, 0));
						CustomEntity.this.addPotionEffect(new EffectInstance(Effects.DOLPHINS_GRACE, 100)); // EXP PART <-------------------
					if (this.action == MovementController.Action.MOVE_TO && !CustomEntity.this.getNavigator().noPath()) {
						double dx = this.posX - CustomEntity.this.getPosX();
						double dy = this.posY - CustomEntity.this.getPosY();
						double dz = this.posZ - CustomEntity.this.getPosZ();
						dy = dy / (double) MathHelper.sqrt(dx * dx + dy * dy + dz * dz);
						CustomEntity.this.rotationYaw = this.limitAngle(CustomEntity.this.rotationYaw,
								(float) (MathHelper.atan2(dz, dx) * (double) (180 / (float) Math.PI)) - 90, 90);
						CustomEntity.this.renderYawOffset = CustomEntity.this.rotationYaw;
						CustomEntity.this.setAIMoveSpeed(MathHelper.lerp(0.125f, CustomEntity.this.getAIMoveSpeed(),
								(float) (this.speed * CustomEntity.this.getAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).getValue())));
						CustomEntity.this.setMotion(CustomEntity.this.getMotion().add(0, CustomEntity.this.getAIMoveSpeed() * dy * 0.1, 0));
					} else {
						CustomEntity.this.setAIMoveSpeed(0);
					}
					
				}
			};
			this.navigator = new SwimmerPathNavigator(this, this.world);
		}

nothing changes... my shark is still slow lol

Last seen on 19:53, 2. Jun 2021
Joined Sep 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
ops sorry actually the code…
Sat, 06/27/2020 - 22:54

ops sorry actually the code above do work... but those particles... is there a way to remove the particles with some Override maybe? also is there another way to change the speed?

Last seen on 23:22, 10. Jul 2021
Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
you don't need to code for…
Sat, 06/27/2020 - 23:36

you don't need to code for this, just give the mob the Dolphin’s Grace potion effect like trolmaso said :)

 

Last seen on 19:53, 2. Jun 2021
Joined Sep 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
how? he did not said how, i…
Sun, 06/28/2020 - 04:28

how? he did not said how, i put this on the movementcontroller part:

 

CustomEntity.this.addPotionEffect(new EffectInstance(Effects.DOLPHINS_GRACE, 100)); // EXP PART 
Last seen on 19:53, 2. Jun 2021
Joined Sep 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
it did work, i was asking…
Sun, 06/28/2020 - 04:30

it did work, i was asking how to remove the particles, or doing on another way... what i really want to know is how to make my Seal mob (water entity) to Also walk on land (it just stands there on land), i put both swim and walking goals too.

Last seen on 19:53, 2. Jun 2021
Joined Sep 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
oh lol now i understand you…
Sun, 06/28/2020 - 04:31

oh lol now i understand you mean on the MCreator creation menu haha yeah off course you can do that too :D

hey mr chips can you help me with the land thing? thanks!

Last seen on 19:53, 2. Jun 2021
Joined Sep 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
@Override public void…
Sun, 06/28/2020 - 04:34
@Override
				public void tick() {
					if (CustomEntity.this.areEyesInFluid(FluidTags.WATER))
						CustomEntity.this.setMotion(CustomEntity.this.getMotion().add(0, 0.005, 0));
						CustomEntity.this.addPotionEffect(new EffectInstance(Effects.DOLPHINS_GRACE, 100)); // EXP PART
					if (this.action == MovementController.Action.MOVE_TO && !CustomEntity.this.getNavigator().noPath()) {
						double dx = this.posX - CustomEntity.this.getPosX();
						double dy = this.posY - CustomEntity.this.getPosY();
						double dz = this.posZ - CustomEntity.this.getPosZ();
						dy = dy / (double) MathHelper.sqrt(dx * dx + dy * dy + dz * dz);
						CustomEntity.this.rotationYaw = this.limitAngle(CustomEntity.this.rotationYaw,
								(float) (MathHelper.atan2(dz, dx) * (double) (180 / (float) Math.PI)) - 90, 90);
						CustomEntity.this.renderYawOffset = CustomEntity.this.rotationYaw;
						CustomEntity.this.setAIMoveSpeed(MathHelper.lerp(0.125f, CustomEntity.this.getAIMoveSpeed(),
								(float) (this.speed * CustomEntity.this.getAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).getValue())));
						CustomEntity.this.setMotion(CustomEntity.this.getMotion().add(0, CustomEntity.this.getAIMoveSpeed() * dy * 0.1, 0));
					} else {
						
						CustomEntity.this.setAIMoveSpeed(1.0F);
						// SOMETHING MUST COME HERE TO MAKE IT WALK IN LAND
					}
				}
			};
			this.navigator = new SwimmerPathNavigator(this, this.world);
		}