Alright so I am kind of interested in disguises such as creating an illusion that a player has turned into a mob. But right now I am wondering what the best way to do this would be? Currently I am thinking of hiding the player and whenever the player moves I would spawn client side mobs and remove the old ones however wouldn't this be quite server intensive?
Skionz I'd just hide the player and spawn a mob with a certain metadata to identify it, then each time the player moves you move the mob. And also when the mob gets hit you cancel the event and apply the damage to the player. Would just need to find a way to change the vanilla attributes (followRange=0, walkingSpeed=0, etc...) of the mob.
I believe it uses craftbukkit's API to send packets and make it appear that an entity is there when it actually is not, and of course, hides the player. Totom3 Your signature confuses me...
Totom3 I'm trying find a way with client side ones but it looks really bad when I use the player move event and create and destroy the client side entity over and over
Skionz Well, I used that method in my plugin couple of days ago... This is what happened: Just geez XD Edit: #CreeperExorcism?
FabeGabeMC Stand near it in survival mode and the problem will definitely be solved, albeit explosively.
The simplest way to do this is to send the destroy packet for the player entity (hiding the player), and then send a creature spawn packet and set the entity id equal to the player's entity id. The server will do the rest. Edit: I do want to make clear that disguise API's are much better and will fix many of the client crashes that can occur with a lot of the disguises. I would just use an API, like LibsDisguises
RingOfStorms The server won't handle it as the entity won't move and it will be stationary... You also need to use PacketPlayOutRelEntityMove and rotate packets...
The entity will move as the server is sending entity move packets with an entity ID of the player. If you spawn your custom mob with the same ID then the client will use the player's move packets for the custom entity. Trust me this is the easiest and cheapest way to do it.