Skip to content

DisplayUtils and PacketUtils

Jay edited this page Sep 5, 2025 · 2 revisions

DisplayEntityUtils consists of two primary utility classes, DisplayUtils and PacketUtils. This wiki page only includes some of this functions from these classes

DisplayUtils

DisplayUtils is a utility class that allows for quickly manipulating display/interaction entities

Get translated location of a Display/Interaction Entity

//Get the location of where the visible model of a display entity is, with rotation (transformation's left rot, entity pitch, and entity yaw) calculations
Location translatedDisplayLocation = DisplayUtils.getModelLocation(displayEntity)

//Get the location of where the visible model of a display entity is, without rotation calculations
Location fixedTranslatedDisplayLocation = DisplayUtils.getFixedModelLocation(displayEntity);

//These do the same as above for PacketDisplayEntityParts
Location translatedDisplayLocation = DisplayUtils.getModelLocation(packetDisplayEntityPart)
Location fixedTranslatedDisplayLocation = DisplayUtils.getFixedModelLocation(packetDisplayEntityPart);

//Get the translation vector of a Interaction entity relative to the Interaction's group
//This will return null if the Interaction entity is not in a SpawnedDisplayEntityGroup
Vector translationVector = DisplayUtils.getInteractionTranslation(interactionEntity);

Pivot an Interaction Entity around a location

double angleInDegrees = 45;
DisplayUtils.pivot(interactionEntity, location, angleInDegrees);

//Get the location where an interaction entity would be pivoted to, without actually pivoting the interaction entity
DisplayUtils.getPivotLocation(interactionEntity, location, anlgeInDegrees);

Check Entity Part/Group tags

//Check if this entity has the provided part tag stored
boolean hasPartTag = DisplayUtils.hasPartTag(entity, partTag);

//Check if this entity's group has the provided group tag
boolean isGroupTag = DisplayUtils.isGroupTag(entity, groupTag);

Check if SpawnedDisplayEntityPart is within a loaded chunk

SpawnedDisplayEntityPart part = yourMethodToGetASpawnedDisplayEntityPart();
boolean isChunkLoaded = DisplayUtils.isInLoadedChunk(part);

PacketUtils (v3.0.0) and later

PacketUtils is a utility class, allowing for manipulating display/interaction entity data through packets

Make an entity glow, only for the given player

Display display = yourMethodToGetADisplayEntity();
boolean glowing = true;
PacketUtils.setGlowing(player, display.getEntityId(), glowing);

int durationInTicks = 20;
PacketUtils.setGlowing(player, display.getEntityId(), glowing, durationInTicks);

Teleport a part only for the given player

PacketDisplayEntityPart part = yourMethodToGetAPart();
PacketUtils.teleport(player, part, location);

//Using the method below would teleport the part for all players who can see the part
part.teleport(location);

Scale an Interaction entity over time for a given player

//There are many variations of this method
float newHeight = 2.0;
float newWidth = 4.0;
int durationInTicks = 15;
int delayInTicks = 0;
PacketUtils.scaleInteraction(player, interaction, newHeight, newWidth, durationInTicks, delayInTicks);

Translate an Interaction entity over time for a given player

//There are many variations of this method
double distance = 12;
int durationInTicks = 15;
int delayInTicks = 0;
PacketUtils.translateInteraction(player, interaction, Direction.FORWARD, distance, durationInTicks, delayInTicks);

DisplayEntityUtils Wiki

Overview

General Help / Examples

Display Groups

Interaction Entities

Animations

Animation Effects (w/ Frame Points)

DisplayControllers (Mounting, Custom Entities & Equipment)

Skript Help / Examples

API Help / Examples

Old Help / Examples

Clone this wiki locally