Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hello,

 

I've got a problem. I'm trying to make a mod that can freeze entities. I tried it with an event handler and the LivingUpdateEvent and setting the entity position to the lastTick position. But that doesn't work. I can't even set the position of a entity, i tried it with the x,y,z vars and with setPosition() but no luck. I've also tried world.isRemote and false.

 

ss7

You sir are a god damn hero.

you could just give the entity potion effect of move slow with power 10 the only problem is that its less effective against other players because they can still move slowly when they jump.

Use examples, i have aspergers.

Examples make sense to me.

I have not personally tried this, but it should be possible to track the position of where the entity was frozen, and then on world tick, force-set the entity back to that position (updating both posX and prevPosX, possibly even lastTickPosX as well).  Try force-setting motionX,Y,Z as well to 0.  (you can synch entity with position using a WeakHashMap with entity as key and the position as value -- use a weak map so as not to leak references)

 

You need to track the freeze position yourself, trying to use the entities own position variables will not work very well because the AI/move methods will adjust those themselves every tick.

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.