Jump to content

[1.7.10] set entity stop falling


deenkayros

Recommended Posts

Hello,

 

I need to grab an entity and keep it stationary in air, i tried this code but it still trying to fall:

  x = player.posX + player.getLookVec().xCoord;
  y = player.posY + player.getLookVec().yCoord;
  z = player.posZ + player.getLookVec().zCoord;
  
  entity.prevPosX = x;
  entity.prevPosY = y;
  entity.prevPosZ = z;
  entity.setPosition(x, y, z);
  
  entity.fallDistance = 0.0F;
  entity.onGround = false;
  entity.isAirBorne = true;
  entity.timeUntilPortal = 5;
  entity.setInWeb();

 

help....

Link to comment
Share on other sites

Hello,

 

I need to grab an entity and keep it stationary in air, i tried this code but it still trying to fall:

  x = player.posX + player.getLookVec().xCoord;
  y = player.posY + player.getLookVec().yCoord;
  z = player.posZ + player.getLookVec().zCoord;
  
  entity.prevPosX = x;
  entity.prevPosY = y;
  entity.prevPosZ = z;
  entity.setPosition(x, y, z);
  
  entity.fallDistance = 0.0F;
  entity.onGround = false;
  entity.isAirBorne = true;
  entity.timeUntilPortal = 5;
  entity.setInWeb();

 

help....

 

What do you mean by "trying to fall"?

If you mean that it tries to fall and rolls back, then you should set its velocity to 0 on both side.

I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP)

II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.

Link to comment
Share on other sites

What do you mean by "trying to fall"?

If you mean that it tries to fall and rolls back, then you should set its velocity to 0 on both side.

 

Yes, I added this code but nothing to do:

entity.motionX = entity.motionZ = entity.motionY = 0.0D;

 

The code is called by the item right click event on the entity ("itemInteractionForEntity") but the entity goes up and down like a glitch ...in short, I need to cancel the event (updateEntity or livingUpdate) where the entity perform the fall ...

Link to comment
Share on other sites

Try canceling the

LivingFallEvent

.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.