Skip to content

Examples

3add edited this page Dec 16, 2025 · 7 revisions

This page lists examples of things you can do with PacketEventsSK. This page is made for you to understand the syntax and ideas of package management, do not just copy paste the listed content.

Welcome Message

on join:
    create new fake text display entity 2 blocks infront of player for player and store it in {_display}:
        set {_content} to mini message from "<rainbow>WELCOME %player's name%"
        set packet display content of the fake entity to {_content}
        set packet display billboard of the fake entity to center
 
    create new fake interaction entity 2 blocks infront of player for player and store it in {_interactable}:
        set packet interaction height of the fake entity to 1
        set packet interaction width of the fake entity to 2
        set {-interactables::%player's uuid%} to packet entity id of the fake entity

    wait 5 seconds

    kill packet entities {_display} and {_interactable}
    clear {-interactables::%player's uuid%}

on interact entity receive netty processed:
   if packet entity id of event-packet is not {-interactables::%player's uuid%}:
      stop

   send "Welcome %player's name%"
image

Clone this wiki locally