Advertisement
xeRicker

Untitled

Jul 24th, 2024
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. WitherSkeleton witherSkeleton = player.getWorld().spawn(player.getLocation(), WitherSkeleton.class);
  2.  
  3. PacketContainer packet = new PacketContainer(PacketType.Play.Server.ENTITY_METADATA);
  4. packet.getIntegers().write(0, witherSkeleton.getEntityId());
  5.  
  6. WrappedDataWatcher watcher = WrappedDataWatcher.getEntityWatcher(witherSkeleton).deepClone();
  7.  
  8. WrappedDataWatcher.Serializer serializer = WrappedDataWatcher.Registry.get(Boolean.class);
  9. watcher.setObject(new WrappedDataWatcher.WrappedDataWatcherObject(3, serializer), true);
  10. packet.getWatchableCollectionModifier().write(0, watcher.getWatchableObjects());
  11.  
  12. ProtocolLibrary.getProtocolManager().sendServerPacket(player, packet);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement