1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Prevent Glitch, When Closing a Inventory

Discussion in 'Development' started by Akmal, Jun 16, 2019.

  1. Akmal

    Akmal Spider

    Messages:
    10
    GitHub:
    AkmalFairuz
    When after i close ChestInventory, sometime will occur :
    [​IMG]
    Scoreboard and player inventory not showing.
    How to prevent this glitch?
    Cause internet lag or other?

    I trying this code on InventoryCloseEvent for prevent this glitch:
    PHP:
    /**
     * @var $player Player
     */
    if($player->getPing() > 300) {
         
    $player->transfer("localhost"19132); // Relogin
    }
    And how to prevent this glitch besides relogin player?
     
  2. KielKing

    KielKing Zombie

    Messages:
    245
    GitHub:
    kielking
    do you have any code running when the player closes the inventory?
     
  3. wolfdale

    wolfdale Zombie Pigman

    Messages:
    535
    GitHub:
    diamond-gold
    If you close the inventory using code (not the player close it) , there is a chance this will happen. It is client side bug. Solution is dont close using code, let the player close it
     
  4. Akmal

    Akmal Spider

    Messages:
    10
    GitHub:
    AkmalFairuz
    Yes, I'm know it is client side bug. My question is how to prevent this glitch besides relogin?
     
  5. wolfdale

    wolfdale Zombie Pigman

    Messages:
    535
    GitHub:
    diamond-gold
    Let the player close the inventory, dont close it server side
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.