Jump to content

Recommended Posts

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?

Posted

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.

Posted

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.

Posted

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.

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.