Evening, Is there a way that I can send a sign menu packet to a player and receive the lines they typed back in the plugin? For example, if I wanted a multi line password, how could I get the sign menu up on the player's screen, have them enter the password they want on each line, and then receive the lines in a string array in the server? I've tried looking this up but I have no experience whatsoever with manipulating packets. EDIT: I am aware that this is in the wrong section and I have requested it to be moved. EDIT2: Fixed.
@Tecno_Wizard I doubt you can do this although I may be wrong. I saw someone do something similar to this with an anvil.
[insert self-deprecating comment about how I've never used packets or protocollib before] I guess you'd send one of these to the player: http://wiki.vg/Protocol#Sign_Editor_Open And then catch this: http://wiki.vg/Protocol#Update_Sign As far as I can tell, the only defining characteristic sent to the client is the block location of the sign. So, every time a player wants to do this, you'd have to generate a fake location where there definitely won't be a real sign, then check that location against the one in any future "update sign" packet received by the server.
@adam753, @Skionz, when all else fails, build random signs! But seriously, could I intercept that packet, cancel the change of the sign that doesnt exist (before it throws an error), and just save that array? Edit: Yea, heck no. LAAAAAGGGGG. Well, looks like it's floating signs at a configurable location then. Actually, would anyone like me to make this into an API?
@mythbusterma, it would throw an event every time a packet is received... Plus i would have to custom create the event.
@Tecno_Wizard Creating and calling an event is not a particularly expensive operation...besides, why would you have to do that? Protocol lib does that for you already.
Plugin "ArmorStandTools" (spigot only apparently, might not work with bukkit) does exactly that. You might want to check in its sources. http://www.spigotmc.org/resources/armor-stand-tools.2237/ (remove the link if it's against the rules)
@mythbusterma, yea, while i am not new to Java i'm still fairly new to bukkit. And @Webbeh, i'll go look at that now.
Well, apparently he added craftbukkit compatibility but removed his github from that page. I'll see if I can get the link back.
@Tecno_Wizard Pretty sure you could intercept the packet without there needing to actually be a sign. I don't see how this would cause a lag issue.
@adam753, that was before someone suggested ProtocalLib, but it will still require a location. I'll probably use the chest's if it allows that.