Jump to content

Recommended Posts

Posted

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....

Posted

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.

Posted

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 ...

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.