How to disguise a serverside mob as another?
Posted
by
Shaun Wild
on Game Development
See other posts from Game Development
or by Shaun Wild
Published on 2012-11-25T18:25:36Z
Indexed on
2012/11/25
23:24 UTC
Read the original article
Hit count: 188
I've been working a Minecraft sever mod and i want to be able to add a new entity to the server, but then make the server send the packets to the client, imitating another mob, for example..
Lets say say i have EntityPlayerNPC.class, what i want to do is have all of the packets that get sent to the client look like they are from that of another player which is on the player, therefore allowing me to add custom NPC's... Thinking about the theory i'm sure this can be done.
I've tried looking around for where the packets are being sent from and whatnot, can anyone think up a solution?
edit:
i tried adding a new constructor to the Packet20NamedEntitySpawn class like so:
public Packet20NamedEntitySpawn(String username, EntityLiving e){
this.entityId = 0;
this.name = username;
this.xPosition = MathHelper.floor_double(e.posX * 32.0D);
this.yPosition = MathHelper.floor_double(e.posY * 32.0D);
this.zPosition = MathHelper.floor_double(e.posZ * 32.0D);
this.rotation = (byte)((int)(e.rotationYaw * 256.0F / 360.0F));
this.pitch = (byte)((int)(e.rotationPitch * 256.0F / 360.0F));
this.metadata = e.getDataWatcher();
}
unfortunatley, that didn't work :(
© Game Development or respective owner