ProtocolLib wrapper for CommandHelper
create_packet(protocol, side, name)
packet_read([packet], index)
packet_write([packet], index, value)
send_packet([player], packet)
packet_info([packet])
all_packets()
protocol, side, name, player, packet
bind(player_join,null,null, @e){
@packet=create_packet('play','out','chat')packet_write(@packet,0,'Hello')packet_write(@packet,2,'GAME_INFO')send_packet(@packet)}bind(packet_event,null,array(name: CHAT), @e){
@info=packet_read(@e[packet],2)if(@info=='GAME_INFO'){packet_write(0,colorize('&cHello CHProtocol!'))}}*:/wb=>>>
@loc=ploc()
@packet=create_packet('play','out','worldBorder')// create a worldborder packetpacket_write(@packet,0,'SET_CENTER')// marking to `set center`packet_write(@packet,1,29999984)// No idea but the server sent this_set_wb_size(@packet,20)// world border size_set_wb_center(@packet,'world', @loc[x], @loc[z])// worldborder centerpacket_write(@packet,7,15)// maybe warning relatedpacket_write(@packet,8,5)// maybe warning relatedsend_packet(@packet)// send the packetset_timeout(0,closure(){// delay 1 tick, because without this doesn't workpacket_write(@packet,0,'SET_SIZE')// remarking to `set_size`send_packet(@packet)// resend the packet})<<<proc_set_wb_size(@packet, @size){packet_write(@packet,4, @size)packet_write(@packet,5, @size)}proc_set_wb_center(@packet, @world, @x, @z){
@modifier=if(world_info(@world)[environment]=='NETHER',8,1)packet_write(@packet,2, @x* @modifier)packet_write(@packet,3, @z* @modifier)}