Support skript-packet 2.0.1
This commit is contained in:
parent
765579bbec
commit
17597352b0
@ -2,20 +2,16 @@
|
|||||||
|
|
||||||
import:
|
import:
|
||||||
net.minecraft.server.v1_16_R3.IScoreboardCriteria$EnumScoreboardHealthDisplay
|
net.minecraft.server.v1_16_R3.IScoreboardCriteria$EnumScoreboardHealthDisplay
|
||||||
net.minecraft.server.v1_16_R3.ScoreboardServer$Action
|
|
||||||
on script load:
|
on script load:
|
||||||
#remove scoreboard objective packet
|
|
||||||
|
|
||||||
set {-scoreboard_objective_remove_packet} to new play_server_scoreboard_objective packet
|
|
||||||
|
|
||||||
set field 3 of {-scoreboard_objective_remove_packet} to 1 #1 means remove
|
|
||||||
|
|
||||||
#create scoreboard objective packet
|
#create scoreboard objective packet
|
||||||
|
|
||||||
set {-scoreboard_objective_create_packet} to new play_server_scoreboard_objective packet
|
set {-scoreboard_objective_create_packet} to new play_server_scoreboard_objective packet
|
||||||
|
#1.16
|
||||||
set field 3 of {-scoreboard_objective_create_packet} to 0 #0 means create
|
set field 3 of {-scoreboard_objective_create_packet} to 0 #0 means create
|
||||||
set field 2 of {-scoreboard_objective_create_packet} to EnumScoreboardHealthDisplay.HEARTS
|
set field 2 of {-scoreboard_objective_create_packet} to EnumScoreboardHealthDisplay.HEARTS
|
||||||
|
#1.12
|
||||||
|
#set int field 0 of {-scoreboard_objective_create_packet} to 0 #0 means create
|
||||||
|
#set {-scoreboard_objective_create_packet}.getHandle().c to EnumScoreboardHealthDisplay.INTEGER
|
||||||
|
|
||||||
#update scoreboard objective packet
|
#update scoreboard objective packet
|
||||||
|
|
||||||
@ -29,11 +25,7 @@ on script load:
|
|||||||
set {-belowname_display_packet} to new play_server_scoreboard_display_objective packet
|
set {-belowname_display_packet} to new play_server_scoreboard_display_objective packet
|
||||||
set field 0 of {-belowname_display_packet} to 2
|
set field 0 of {-belowname_display_packet} to 2
|
||||||
|
|
||||||
#set the number displayed
|
effect set below[ ]name [display] of %player/string% for %player% to %number% named %string%:
|
||||||
|
|
||||||
set {-scoreboard_score_packet} to new play_server_scoreboard_score packet
|
|
||||||
|
|
||||||
effect set below[ ]name of %player/string% for %player% to %number% named %string%:
|
|
||||||
trigger:
|
trigger:
|
||||||
#register scoreboard objective
|
#register scoreboard objective
|
||||||
if {-hpbelowpacket::%expression 2%} is not set:
|
if {-hpbelowpacket::%expression 2%} is not set:
|
||||||
@ -45,8 +37,11 @@ effect set below[ ]name of %player/string% for %player% to %number% named %strin
|
|||||||
set {_uuid} to first 16 characters of random uuid
|
set {_uuid} to first 16 characters of random uuid
|
||||||
|
|
||||||
set field 0 of {_packet} to {_uuid}
|
set field 0 of {_packet} to {_uuid}
|
||||||
|
#1.16
|
||||||
set field 1 of {_packet} to nms textcomponent from text (expression 4)
|
#set field 1 of {_packet} to nms textcomponent from text (expression 4)
|
||||||
|
set field 1 of {_packet} to expression 4
|
||||||
|
#1.12
|
||||||
|
#set string field 1 of {_packet} to expression 4 #text that is displayed below name
|
||||||
|
|
||||||
send packet {_packet} to expression 2
|
send packet {_packet} to expression 2
|
||||||
set {-hpbelowpacket::%expression 2%} to expression 4
|
set {-hpbelowpacket::%expression 2%} to expression 4
|
||||||
@ -63,23 +58,30 @@ effect set below[ ]name of %player/string% for %player% to %number% named %strin
|
|||||||
|
|
||||||
else if {-hpbelowpacket::%expression 2%} is not expression 4:
|
else if {-hpbelowpacket::%expression 2%} is not expression 4:
|
||||||
|
|
||||||
set {_packet} to {-scoreboard_objective_update_packet}
|
set {_packet} to new play_server_scoreboard_objective packet
|
||||||
|
set field 3 of {_packet} to 2
|
||||||
set field 0 of {_packet} to {-hpbelowpacketid::%expression 2%}
|
set field 0 of {_packet} to {-hpbelowpacketid::%expression 2%}
|
||||||
|
set field 2 of {_packet} to EnumScoreboardHealthDisplay.HEARTS
|
||||||
#1.16
|
#1.16
|
||||||
set field 1 of {_packet} to nms textcomponent from text (expression 4)
|
#set field 1 of {_packet} to nms textcomponent from text (expression 4)
|
||||||
|
set field 1 of {_packet} to expression 4
|
||||||
|
#1.12
|
||||||
|
#set string field 1 of {_packet} to expression 4 #new text displayed below name
|
||||||
|
|
||||||
send packet {_packet} to expression 2
|
send packet {_packet} to expression 2
|
||||||
set {-hpbelowpacket::%expression 2%} to expression 4
|
set {-hpbelowpacket::%expression 2%} to expression 4
|
||||||
|
|
||||||
#set the number displayed
|
#set the number displayed
|
||||||
|
|
||||||
set {_packet} to {-scoreboard_score_packet}
|
set {_packet} to new play_server_scoreboard_score packet
|
||||||
set field 2 of {_packet} to expression 3 #number
|
set field 2 of {_packet} to expression 3 #number
|
||||||
set field 0 of {_packet} to "%expression 1%" #player name
|
set field 0 of {_packet} to "%expression 1%" #player name
|
||||||
set field 1 of {_packet} to {-hpbelowpacketid::%expression 2%}
|
set field 1 of {_packet} to {-hpbelowpacketid::%expression 2%}
|
||||||
|
set field 3 of {_packet} to "CHANGE"
|
||||||
|
#TODO FIX THIS KICKING PLAYERS
|
||||||
send packet {_packet} to expression 2
|
send packet {_packet} to expression 2
|
||||||
|
|
||||||
effect (remove|reset|delete|clear) below[ ]name (for|of) %player%:
|
effect (wipe|remove|reset|delete|clear) below[ ]name [display] (for|of) %player%:
|
||||||
trigger:
|
trigger:
|
||||||
#removed this condition... as it was sometimes preventing legitimate reset, maybe sometimes it just needs to do it twice?)
|
#removed this condition... as it was sometimes preventing legitimate reset, maybe sometimes it just needs to do it twice?)
|
||||||
#{-hpbelowpacketid::%expression 1%} is set:
|
#{-hpbelowpacketid::%expression 1%} is set:
|
||||||
@ -88,13 +90,20 @@ effect (remove|reset|delete|clear) below[ ]name (for|of) %player%:
|
|||||||
set {_id} to "%{-hpbelowpacketid::%expression 1%}%"
|
set {_id} to "%{-hpbelowpacketid::%expression 1%}%"
|
||||||
wait 2 ticks
|
wait 2 ticks
|
||||||
{_id} is "%{-hpbelowpacketid::%expression 1%}%"
|
{_id} is "%{-hpbelowpacketid::%expression 1%}%"
|
||||||
set belowname of expression 1 for expression 1 to 0 named "reset"
|
set {_packet} to new play_server_scoreboard_objective packet
|
||||||
set {_packet} to {-scoreboard_objective_remove_packet}
|
set field 3 of {_packet} to 1 #1 means remove
|
||||||
|
#set field 2 of {_packet} to EnumScoreboardHealthDisplay.HEARTS
|
||||||
set field 0 of {_packet} to {-hpbelowpacketid::%expression 1%}
|
set field 0 of {_packet} to {-hpbelowpacketid::%expression 1%}
|
||||||
|
#TODO FIX THIS KICKING PLAYERS
|
||||||
send packet {_packet} to expression 1
|
send packet {_packet} to expression 1
|
||||||
|
|
||||||
delete {-hpbelowpacketid::%expression 1%} and {-hpbelowpacket::%expression 1%}
|
delete {-hpbelowpacketid::%expression 1%} and {-hpbelowpacket::%expression 1%}
|
||||||
|
#on packet event play_server_scoreboard_objective:
|
||||||
|
# player is "Govindas"
|
||||||
|
# send "play_server_scoreboard_objective" to ops
|
||||||
|
# loop integers from 0 to 5:
|
||||||
|
# field loop-number of event-packet is set
|
||||||
|
# send "field %loop-number%: %field loop-number of event-packet%" to ops
|
||||||
on quit:
|
on quit:
|
||||||
remove belowname for player
|
remove belowname for player
|
||||||
on player world change:
|
on player world change:
|
||||||
|
Loading…
Reference in New Issue
Block a user