#teleportation packet error

1 messages · Page 1 of 1 (latest)

deft parrot
#

So I am editing the packet fields with ProtocolLib and it sent me an error:

#

com.comphenix.protocol.reflect.FieldAccessException: No field with type double exists in class PacketPlayOutRelEntityMoveLook.

#

Here's my code:

public class Teleport implements CommandExecutor {
    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

        if (sender instanceof Player) {

            ProtocolManager manager = ProtocolLibrary.getProtocolManager();

            Player p = (Player) sender;

            PacketContainer packet = manager.createPacket(PacketType.Play.Server.REL_ENTITY_MOVE_LOOK);

            packet.getDoubles().write(0, p.getLocation().getX()+1);
            packet.getDoubles().write(1, p.getLocation().getY());
            packet.getDoubles().write(2, p.getLocation().getZ());

            try {
                manager.sendServerPacket(p, packet);
            } catch (InvocationTargetException e) {
                e.printStackTrace();
            }

        }

        return true;
    }
}```
latent hound
#

I mean it tells you

#

That packet has no doubles

deft parrot
#

But in the docs it says it does

latent hound
#

It’s probably wrapped into something by protocollib

deft parrot
#

I don't understand what ProtocolLib wrapping is, could you explain what it is and what I should be doing differently?

latent hound
#

Wrapping several objects into another object

#

Probably a location or something

#

Nope checked packet wrapper

#

They are shorts

wise sparrow
#

ProtocolLib only wraps nms packets