[SPIGOT-7662] Add API method to send a clientside entity to a player via packets Created: 07/May/24  Updated: 25/Dec/24

Status: Open
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Minor
Reporter: Peaches_MLG Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None

Version: 1.20.6
Guidelines Read: Yes

 Description   

An API option to send an entity spawn/despawn event to a player via packets would be useful.

I have used this in the past to create Hologram's by sending a player an armorstand spawn packet via nms.

I find this approach better than spawning in an actual armostand since its less error prone (the packets are all client side so there is no chance that you will have duplicate armorstands, or any cleanup if you remove the plugin)

Currently the only way to do this is via NMS, so a Player#sendEntitySpawn and a Player#sendEntityDespawn would be a useful method



 Comments   
Comment by coll1234567 [ 08/May/24 ]

This could be a good use for virtual entities and/or EntitySnapshot.

Comment by md_5 [ 08/May/24 ]

I just don't think there's any possible way to do this without copying literally every entity method but manually implementing this with packets. It would be hundreds of hours of work and break every update.

If the entities don't have AI or anything there processing power is not going to be significant. Also we have display entities now...

Comment by Peaches_MLG [ 08/May/24 ]

My main concern would be around Performance, if you need a Hologram (armor stand) per player, and spawn has 10 Holograms for example.

Depending on how many players are on the server, that can easily be alot of armor stands being processed server side, and could easily lead to 1000 entities server side at spawn.

Thinking about it a bit more though, not sure how much processing power is needed for an armorstand, its probably fairly negligible.

Comment by md_5 [ 07/May/24 ]

It's a pretty open problem as to how you copy the entire entity API but for packets only

Why is the above unsatisfactory?

Comment by Peaches_MLG [ 07/May/24 ]

Yeah, but this still requires the entity to exist server side.

I want to show a player an entity that only exists client side, and doesnt exist on the server

Comment by md_5 [ 07/May/24 ]

Entity.setPersistent, Entity.setVisibleByDefault and Player.showEntity exist

Generated at Wed Dec 17 13:24:23 UTC 2025 using Jira 10.3.15#10030015-sha1:909cc43d292ca09e774c1a243d9819be3f2628cd.