Individual signs? Changing what sign displays for each player?

Discussion in 'Plugin Development' started by DCuno, Nov 10, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    DCuno

    I'm going to be direct here, If I created a sign written:
    Your name is [n]
    Bill would see Your name is Bill
    Jan would see Your name is Jan

    I know how to edit the sign once it is edited via SignEditEvent but this would'nt allow players to see it written in a different way.
    So, is there any method that give me access to what players see in the sign's content?
    Thanks for reading and I'll wait for any answer patiently.
     
  2. Offline

    gomeow

    I don't think so
     
  3. Offline

    ZeusAllMighty11

    I was going to suggest packets, but what if 2 players were at the same sign??

    Not possible? Not sure.
     
  4. Offline

    Uniclaw

    Just send Packet's on each Player on his join event, so that the sign is faked for him on join :)
     
  5. Offline

    Kodfod

    Well, you could send Block changes.... couldn't you?
     
  6. Offline

    DCuno

    I got no clue how to use these packets =/
     
  7. Offline

    DCuno

    Packet130UpdateSign packet = new Packet130UpdateSign();
    I got the packet object but dunno how to modify it :/
    Any clues/examples?
     
  8. Offline

    Zidkon

    Best logic way to do it is sending individual packet to each person, since the client doesn't do this work for you, but I don't know how to modify the Packet130UpdateSign sorry :/
     
  9. Offline

    desht

    It should certainly be possible to do by intercepting and modifying Packet130UpdateSign packets. It's something I've been meaning to look into for ScrollingMenuSign (sign views with per-player scroll positions), but haven't had the time yet. The smart way to do it would be to use Comphenix 's excellent ProtocolLib : http://forums.bukkit.org/threads/li...asily-modify-sent-and-recieved-packets.101035 and register a server-side listener.

    Packet130SignUpdate has x, y, z int fields for the sign's location, and a lines String array for the sign's text. That should be sufficient information to easily modify the packets as they leave the server (the player can be obtained from the ProtocolLib event).
     
Thread Status:
Not open for further replies.

Share This Page