Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on packet event play_client_update_sign:
- cancel event
- set {_lines::*} to string array pinfo 0 of event-packet
- set {_loc} to location pinfo 0 of event-packet
- set line 1 of block at {_loc} to colored {_lines::1}
- set line 2 of block at {_loc} to colored {_lines::2}
- set line 3 of block at {_loc} to colored {_lines::3}
- set line 4 of block at {_loc} to colored {_lines::4}
- on rightclick:
- player is op
- player is sneaking
- player's tool is air
- id of clicked block is 63 or 68
- set {_signdata} to new play_server_tile_entity_data packet
- set location pinfo 0 of {_signdata} to location of clicked block
- set int pnum 0 of {_signdata} to 9
- set {_linevalue::1} to "{\""text\"":\""%line 1 of clicked block%\""}"
- set {_linevalue::2} to "{\""text\"":\""%line 2 of clicked block%\""}"
- set {_linevalue::3} to "{\""text\"":\""%line 3 of clicked block%\""}"
- set {_linevalue::4} to "{\""text\"":\""%line 4 of clicked block%\""}"
- replace "§" in {_linevalue::*} with "&"
- set "Nbt" pjson 0 of {_signdata} to "{""name"":null,""type"":""compound"",""value"":{""x"":{""name"":""x"",""type"":""int"",""value"":%floor(x-loc of clicked block)%},""y"":{""name"":""y"",""type"":""int"",""value"":%floor(y-loc of clicked block)%},""z"":{""name"":""z"",""type"":""int"",""value"":%floor(z-loc of clicked block)%},""Text1"":{""name"":""Text1"",""type"":""string"",""value"":""%{_linevalue::1}%""},""Text2"":{""name"":""Text2"",""type"":""string"",""value"":""%{_linevalue::2}%""},""Text3"":{""name"":""Text3"",""type"":""string"",""value"":""%{_linevalue::3}%""},""Text4"":{""name"":""Text4"",""type"":""string"",""value"":""%{_linevalue::4}%""}}}" parsed as jsonobject
- set {_openeditor} to new play_server_open_sign_editor packet
- set location pinfo 0 of {_openeditor} to location of clicked block
- send player packet {_signdata}
- send player packet {_openeditor}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement