Jump to content

FilUnderscore

Members
  • Posts

    5
  • Joined

  • Last visited

FilUnderscore's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I do set my client-side entity's ID and UUID through entity.setEntityID() and entity.setUniqueID() from the packet before adding it, which I notice you aren't doing?
  2. I believe that this line: world.addEntity(msg.shooterId,entity); should be: world.addEntity(entity.getEntityID(),entity); I don't know whether this has anything to do with the threading?
  3. 1.14.3 - Forge 27.0.51 It's a method in the ClientWorld class in this version of Forge.
  4. After reading your previous responses, I've managed to do the same thing and got my entity to spawn too - following the SimpleChannel implementation, the main thing is that apparently you need to call world.addEntity(entID, entityInstance) instead of world.addEntity(entityInstance)
  5. Hey, so I've managed to spawn my custom entity by letting my custom spawn packet implement IPacket<ClientPlayNetHandler> and processing the packet in the packet class as well by using some of the code from ClientPlayNetHandler - handleSpawnObject(SSpawnObjectPacket packetIn) I also return a new packet instance in my entity class in the createSpawnPacket() method. i.e. process method in my packet class @Override public void processPacket(ClientPlayNetHandler handler) { Entity entity = entityType.create(handler.getWorld()); entity.func_213312_b(this.x, this.y, this.z); entity.rotationPitch = (float)(this.pitch * 360) / 256.0F; entity.rotationYaw = (float)(this.yaw * 360) / 256.0F; entity.setEntityId(this.entityId); entity.setUniqueId(this.uuid); handler.getWorld().addEntity(this.entityId, entity); } createSpawnPacket() in my entity class @Override public IPacket<?> createSpawnPacket() { return new MagicModEntitySpawnPacket(MagicModRegistry.TestEntityType, this.getEntityId(), this.entityUniqueID, this.posX, this.posY, this.posZ, this.rotationYaw, this.rotationPitch); }
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.