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

I have armor that, once worn, allows players to fly.  This speed is pretty fast and feels very op.  I tried to go under player.capabilities.setFlySpeed(speed) and set, and it does work in single player, but using that on a server doesn't work. 

 

I tried to go as far as to check if the player is flying, then give them a potion affect to slow them, and it only seems to affect FOV while in the air and not speed. 

 

I also tried to set an Ability Modifier for movement_speed, and that only affects players on the ground. 

 

Is there a potential way to slow players down while flying or anything someone could suggest I look at to see how to deal with this?

Can't you make a packet to send to the clients telling them to change the fly speed with setFlySpeed? You can then have code which runs on the server to ensure that they do not move too quickly and kick them if needed (have a server config option for that).

 

That is a solution.

  • Author

I would think that the problem would come with the server side of things, right?  The setFlySpeed() is Client side only, so the server doesn't know what to do with it, and if I set it up so the client makes the decision, that works in single player, but not on a multiplayer server. 

 

I just didn't know if there was something else other than the setFlySpeed() that i could call that the server would understand.

 

 

This is my code atm http://pastebin.com/M1VSstMv.  I have a lot of the extra stuff commented out, but I was trying to have the flight speed reduction happen only if the player was not in creative mode and only while flying(if I had to limit it by a different attribute factor).With it like this, I can fly with all 4 pieces, it is just the regular flight speed which is pretty darn fast, especially if you sprint with it.

  • Author

Thinking about it, I could try to use setVelocity() and take the current motion speed and just subtract from it.  I will have to try that later when I get home.

  • Author

Solved it, adding a negative number to velocity did what I wanted.  Thanks!

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.