If levitation status effect reset player fall distance

Discussion in 'Plugin Requests' started by RubySparks, Apr 1, 2018.

Thread Status:
Not open for further replies.
  1. Hello,

    Plugin Category: Vanilla Bugfix
    Mineraft Version: 1.12.2
    SuggestedName: LevitationFix
    What I want:
    Levitation effect in minecraft does not reset the fall distance, it's an annoying bug for my server. Is it maybe possible to check if any player has the levitation effect to reset the NBT fallDistance player tag to zero?

    Commands: Mabye turn it off and on
  2. Offline


  3. Offline


    @DeepSoundHunter of course is totally legal but dont you think its a bit cpu consuming to check all player movements on every tick? Im just saying there are events like PlayerItemConsumeEvent and PotionSplashEvent where you could start a timer. Of course you then had to check things like PlayerDeathEvent, PlayerWorldChangeEvent and so on as well. Idk just fyi
  4. Offline


    Yes i agree, but i do not know how the effect is set to the player on his server... so i had to check every possibility(like it could be that a other plugin is setting this effect to the player so PlayerConsumeEvent or PotionSplashEvent would not work)... and the easiest way was to check everytime he moves... and so far for his server it was not that cpu consuming so if no one else needs this plugin or has cpu problems with it I don't think I have to change it.
    MightyOne likes this.
  5. Offline


  6. Offline


    I'm not personally a 1.9+ developer but I know in 1.8 you could use a runnable to check every 10 or so ticks and then you can use player.hasPotioneffect([effect]) and if they have levitation, player.setFallDistance(0.0F)
    And as you won't take fall damage from 3 or less blocks I think that would work ;)
  7. Offline


    @DeepSoundHunter has a fully functional plugin, but perhaps there is a better way. If @RubySparks could offer more insight into how the bug is impacting their server, and perhaps some information on how players are acquiring the potion effect, then it could be possible to mitigate the issues without requiring the server to check every single player movement. Keep in mind that move events are very common as they occur even when a player moves their mouse to look around, and could prove to be computationally expensive on servers with many players.
Thread Status:
Not open for further replies.

Share This Page