Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

FilUnderscore

Members
  • Joined

  • Last visited

Everything posted by FilUnderscore

  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); }

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.