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

Check if player has opened chat

Discussion in 'Development' started by kaliiks, Feb 19, 2017.

  1. kaliiks

    kaliiks Zombie

    Messages:
    250
    Can i do it?
     
  2. Sandertv

    Sandertv Zombie Pigman Poggit Reviewer

    Messages:
    786
    GitHub:
    Sandertv
    It's completely a client thing so I'm quite sure it is not possible.
     
    corytortoise likes this.
  3. Bluplayz

    Bluplayz Spider Jockey

    Messages:
    43
    GitHub:
    bluplayz
    its possible ^^

    you must catch the PlayerActionPacket and it will call with action id 1 i think, you must experiment something ^^
     
  4. Sandertv

    Sandertv Zombie Pigman Poggit Reviewer

    Messages:
    786
    GitHub:
    Sandertv
    No, it will not. It is not possible like that.
     
    Muqsit and corytortoise like this.
  5. Redux

    Redux Spider Jockey

    Messages:
    49
    GitHub:
    reduxredstone
    Opening chat is purely client side. There is no packet for it. And even if there is, it is not `PlayerActionPacket`.
     
  6. Bluplayz

    Bluplayz Spider Jockey

    Messages:
    43
    GitHub:
    bluplayz
    Then tell me why they sent a actionpacket if i tap the chat button lol
     
  7. Redux

    Redux Spider Jockey

    Messages:
    49
    GitHub:
    reduxredstone
    Go ahead and post some example code then.
     
    HimbeersaftLP, Muqsit and Sandertv like this.
  8. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    PHP:
    //class PlayerActionPacket..
    const ACTION_ABORT_BREAK 1;
     
    HimbeersaftLP, Redux and Sandertv like this.
  9. robske_110 (Tim)

    robske_110 (Tim) Wither Skeleton Poggit Reviewer

    Messages:
    1,342
    GitHub:
    robske110
    Nope, no packet is sent. Just checked.
     
    HimbeersaftLP and Redux like this.
  10. Bluplayz

    Bluplayz Spider Jockey

    Messages:
    43
    GitHub:
    bluplayz
    sure xD


    PHP:
    public function onDataPacketReceive(DataPacketReceiveEvent $event)
    {
        
    $packet $event->getPacket();
        if (
    $packet instanceof PlayerActionPacket) {
            
    //$this->plugin->getLogger()->warning("DataPacket: PlayerActionPacket was received with action id: " . $packet->action);
        
    }
    }
    go on server and if you opend the chat, then he send you PlayerActionPacket with action id 1 lol
     
  11. Redux

    Redux Spider Jockey

    Messages:
    49
    GitHub:
    reduxredstone
    That packet ID seems to be used for several things and would be very inconsistent to use. The simple act of joining the server sends a PlayerActionPacket with ID 1. It also sends an ID of 1 when you stop mining a block. This is not a solution to the problem.
     
  12. robske_110 (Tim)

    robske_110 (Tim) Wither Skeleton Poggit Reviewer

    Messages:
    1,342
    GitHub:
    robske110
    nope.
     
  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.