Client Side Glowing Effect (using custom packet with MUNDOSK)

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

aeim

Member
Feb 21, 2017
38
5
8
27
Hi,
I try to make a skript that allows to apply the glow effect on multiples entities but only visible to the player who executes the command. I try to send a custom packet to a player but that is not enough because it also needs to change the play_server_entity_metadata.

Here is my code and a few helpers:
code_language.skript:
command /glow:
    trigger:
        set {_packet} to new play_server_entity_effect packet
        set int pnum 0 of {_packet} to 8
        set byte pnum 0 of {_packet} to 24 #effect
        set byte pnum 1 of {_packet} to 1  #amplifier
        set int pnum 1 of {_packet} to 20  #duration
        set byte pnum 2 of {_packet} to 2  # 0=hide particle / 2=show particle
        send player packet {_packet}

result with a function:
code_language.skript:
ApplyGlowFor(loop-entity, player)

http://wiki.vg/Entities#Living
https://forums.skunity.com/threads/snow-pyons-code-snippets.242/
https://www.spigotmc.org/threads/glow-effect-for-only-one-client.127634/
https://www.spigotmc.org/threads/simulating-potion-effect-glowing-with-protocollib.218828/

Spigot 1.9.2 / Skript 2.2-fixes-V9b ( official v1.5)
def4d62151.png


Thank you for your help
 
Hi,
I try to make a skript that allows to apply the glow effect on multiples entities but only visible to the player who executes the command. I try to send a custom packet to a player but that is not enough because it also needs to change the play_server_entity_metadata.

Here is my code and a few helpers:
code_language.skript:
command /glow:
    trigger:
        set {_packet} to new play_server_entity_effect packet
        set int pnum 0 of {_packet} to 8
        set byte pnum 0 of {_packet} to 24 #effect
        set byte pnum 1 of {_packet} to 1  #amplifier
        set int pnum 1 of {_packet} to 20  #duration
        set byte pnum 2 of {_packet} to 2  # 0=hide particle / 2=show particle
        send player packet {_packet}

result with a function:
code_language.skript:
ApplyGlowFor(loop-entity, player)

http://wiki.vg/Entities#Living
https://forums.skunity.com/threads/snow-pyons-code-snippets.242/
https://www.spigotmc.org/threads/glow-effect-for-only-one-client.127634/
https://www.spigotmc.org/threads/simulating-potion-effect-glowing-with-protocollib.218828/

Spigot 1.9.2 / Skript 2.2-fixes-V9b ( official v1.5)
def4d62151.png


Thank you for your help
There is currently a problem with Skript and different number types that is preventing us from being able to do glow effect with packets, but we are working on a solution that will allow you to do this.

The function would be something like this (Modifying some code from @Snow-Pyon that was posted in the MundoSK discord channel)
code_language.skript:
function applyGlowFor(entity: entity, player: player):
   set {_packet} to new play_server_entity_metadata packet
   set {_player}'s world pentity 0 of {_packet} to {_entity}
   set {_json::0} to "64" parsed as a byte
   set "watchablecollection" pjson 0 of {_packet} to json from listvar {_json::*}
   send {_player} packet {_packet}

Unfortunately, there seems to be a problem that prevents the packet from working properly (Skript returns something that isn't a byte (probably a long) when parsing "64", but the packet requires a byte). If you want, you can try this to see if it works on your server, and you can also try to see if changing things in your aliases file helps.
 
Status
Not open for further replies.