Bug: Disguise Mechanic Causes Player Kicking

Discussion in 'Bug Reports' started by Duckling, Nov 12, 2020.

  1. Duckling

    Duckling New Member
    Premium Supporter Supporter

    Joined:
    Jun 23, 2016
    Messages:
    13
    Likes Received:
    5
    Enter a brief description of what is broken Disguise Mechanic Causes Player Kicking

    What version of Minecraft are you using? 1.16

    What server jar are you using? PaperSpigot

    What is this a bug report for? MythicMobs

    What version of the plugin are you using? MythicMobs v4.11.-3490

    Describe the bug. Be as specific as possible, images or short gifs/videos are welcome but save configuration files for later sections. Write a whole paragraph if needed, help us bug testers replicate your issue!
    So I believe I have found a bug with the Disguise mechanic (via LibsDisguises) in 1.16.4. I have the latest version of Premium MythicMobs, of LibsDisguises, and of ProtocolLib. When a player is alone in a chunk (no other players are in the chunk) with a disguised MythicMob, if they spawn into that chunk for any number of reasons (they respawn there, they log in there, they teleport/warp to there), then theres a chance they will be disconnected from the server with the following error:

    ```
    Internal Exception: io.netty.handler.codec.DecoderException: java.lang.IndexOutOfBoundsException: readerIndex(12) + length(1) exceeds writerIndex(12): PooledUnsafeDirectByteBuf(ridx: 12, widx: 12, cap: 12)
    ```
    (Sometimes that 12 is a 14 & maybe even other values.)

    When no MythicMobs are spawning (doMobSpawning false, difficulty peaceful) the error does not occur. Otherwise, when a player is teleported to spawn, or comes back to the Overworld via a nether portal, or logs in, etc etc, they are sometimes kicked with the above error. (perhaps 1 in 8 times, they are kicked).

    Reproducibility:
    I set my alt account's spawn in a chunk, in the same chunk, I have a glass cube. I spawned individual mythicmobs in the cube, one at a time. For example, I spawned a custom 'Leaping Spider' that has no Disguise. I use the console to repeatedly kill the player (gamerule doImmediateRespawn true). The error does not occur in several (30+ attempts). I kill the spider and spawn instead, a custom 'Urgle' which is a zombie disguised as a baby zombified piglin. Within the first 10 kills on the player, they are disconnected with the above error. This behavior is consistent: mobs with the Disguise mechanic cause the player to disconnect, others do not.

    Example Configurations
    DISGUISED MOB EXAMPLES
    Urgle:
    Type: BABY_ZOMBIE
    Display: '&1Urgle'
    Health: 12
    KillMessages:
    - '<target.name>&r was sent to the Urgle'
    - '<target.name>&r fell out of the Urgle'
    - '<target.name>&r forgot how to Urgle'
    - '<target.name>&r could not swim in Urgle'
    Equipment:
    - UrgleTendril HAND
    - UrgleSkull HEAD
    Damage: 4
    Drops:
    - UrgleTendril 1 0.2
    - POPPED_CHORUS_FRUIT 1-10 1
    - PINK_DYE 1-10 0.7
    - PINK_CONCRETE_POWDER 1-10 0.7
    Options:
    MovementSpeed: 0.25
    PreventOtherDrops: true
    Silent: true
    Disguise:
    Type: Urgle
    Skills:
    # - command{cmd="disguiseplayer <mob.uuid> PIG_ZOMBIE setCustomName <&dq>&1Urgle<&dq>"} @self ~onSpawn 1
    - effect:sound{s=entity.guardian.flop;volume=0.9;pitch=1.3} @Self ~onDamaged 1
    - effect:sound{s=entity.elder_guardian.hurt;volume=0.9;pitch=1.3} @Self ~onAttack 0.6
    - effect:sound{s=ambient.underwater.exit;volume=0.9;pitch=0.7} @Self ~onDeath 1
    - effect:sound{delay=20;s=ambient.underwater.exit;volume=0.9;pitch=0.6} @Self ~onDeath 1
    - effect:sound{delay=40;s=ambient.underwater.exit;volume=0.9;pitch=0.5} @Self ~onDeath 1
    - skill{s=UrgleDeath} @trigger ~onDeath 0.9
    - effect:smoke @self ~onDamaged <50% 1

    UNDISGUISED EXAMPLE
    LeapingSpider:
    Type: CAVE_SPIDER
    Display: '&cLeaping Spider'
    Health: 20
    KillMessages:
    - '<target.name>&r was leapt at by Leaping Spider'
    - '<target.name>&r did not anticipate the velocity of Leaping Spider'
    Damage: 5
    Drops:
    - STRING 3-6 1
    - SPIDER_EYE 3-6 1
    - GlandOfLeaping 1 0.2
    Options:
    MovementSpeed: 0.27
    PreventOtherDrops: true
    Silent: true
    Modules:
    ThreatTable: true
    Skills:
    - effect:sound{s=entity.spider.hurt;volume=0.9;pitch=0.6} @Self ~onDamaged
    - effect:sound{s=entity.spider.ambient;volume=0.9;pitch=0.6} @Self ~onAttack
    - effect:sound{s=entity.spider.death;volume=0.9;pitch=0.6} @Self ~onDeath
    - skill{s=SpiderLeap} @target ~onEnterCombat
     
    #1
  2. Vergily

    Vergily New Member

    Joined:
    Sep 22, 2017
    Messages:
    1
    Likes Received:
    0
    Disguise:
    Type: Urgle!!!!
     
    #2
  3. Duckling

    Duckling New Member
    Premium Supporter Supporter

    Joined:
    Jun 23, 2016
    Messages:
    13
    Likes Received:
    5
    LibsDisguises supports creating custom disguises. So Urgle is a valid disguise on the server :)
    "/savedisguise" can be used to save custom disguises to short names like "Urgle".

    As of today (11/23/2020) on the latest dev build of MythicMobs and the latest release of LibsDisguises, the issue persists as previously described.
     
    #3
  4. Duckling

    Duckling New Member
    Premium Supporter Supporter

    Joined:
    Jun 23, 2016
    Messages:
    13
    Likes Received:
    5
    Here is a screenshot of the message the player receives when they are kicked:
    upload_2020-11-23_15-24-33.png

    The numbers sometimes change but it doesn't seem to follow any pattern I can discern.
     
    #4
  5. OnwexryS

    OnwexryS New Member
    Premium Supporter Supporter

    Joined:
    Nov 30, 2019
    Messages:
    17
    Likes Received:
    0
    Villagers disguised as player are also kicks players on right click while villager is looking an inventory. To fix that we have to set the villagers profession to nitwit or we have to cancel the event if villager is working.
    There are some exceptions like that can you explain the details of your custom disguise ?
     
    #5
  6. Duckling

    Duckling New Member
    Premium Supporter Supporter

    Joined:
    Jun 23, 2016
    Messages:
    13
    Likes Received:
    5
    A disguise as simple as this still causes the problem:
    SnitchMonkey: Zombie baby setCustomName "&2Snitch Monkey"

    I disguise a spider as a Zombie (because then it can climb around on walls like a monkey. It makes sense in my head XD.)
     
    #6
  7. OnwexryS

    OnwexryS New Member
    Premium Supporter Supporter

    Joined:
    Nov 30, 2019
    Messages:
    17
    Likes Received:
    0
    Good idea :)
    I use drowneds disguised as cod to make them piranha :D
     
    #7
  8. Duckling

    Duckling New Member
    Premium Supporter Supporter

    Joined:
    Jun 23, 2016
    Messages:
    13
    Likes Received:
    5
    Update: This appears to be an issue with LibsDisguises, as the behavior is replicated when a Player rather than a Mob is disguised.
     
    #8

Share This Page