Jump to content

[Solved] [1.11.2] Player kicked for using my mods custom flight.


Recommended Posts

Posted (edited)

I made my own form of levitation for my mod and when using it the server kicks the player for flying. I understand that there is a private floatingTickCount variable in NetHandlerPlayServer that will kick a player for floating for 80 ticks. To get around this you can allow flight from the server properties, but I do believe this leaves the server vulnerable to hacked clients being able to fly around, also I don't want users to have to change this setting for my mod as other flight mods, like with jetpacks, don't require this. I looked into SimplyJetpacks2 source and it looks like they use reflection to access the floatingTickCount and reset it to 0. What I was doing before I looked into SimplyJetpacks2 source was go to change EntityPlayer#capability.allowFlying = true which is how you give a player creative flight but I would only set this on the server and NOT the client, this ensured the player didn't get kicked for flying but also didn't give the player actual creative flight on the client, although it still disables fall damage but that's not a big deal. Then when the player turns off the levitation or runs out of mana or whatever disables their levitation I change EntityPlayer#capability.allowFlying = false and again I only do this on the server. 

I'm wondering how I should go about making sure players don't get kicked for using my mods levitation and not have to allow flight in the server properties. If I use my original method, which was changing EntityPlayer#capability.allowFlying I'm mainly worried about whether or not this is ok to do and also no idea how this will affect other mods that use this for flight. I think if they update this every tick then it's ok because I only change this value when the spell is activated or deactivated.

Edited by Kriptikz

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.