You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As you may have noticed versions 1.8 -1.12 are not supported, why?
Because from 1.13 it is possible to set the pose of the npc to SLEEPING.
In previous versions instead you have to use a PacketPlayOutBed, which causes problems.
Using this code I can make him sleep, however I cannot make the bed invisible.
As you can see in the image the npc skin is not visible, why? because in this version(1.8.8) a ClassNotFoundException is thrown referring to the Guava MultiMap.
The solution is * not * to import the entire library as it weighs 3MB.
The text was updated successfully, but these errors were encountered:
I tested this code and it works (1.12.2).
I found that it only works when use ProtocolLibrary.getProtocolManager().sendServerPacket().
If you use ProtocolLibrary.getProtocolManager().broadcastServerPacket() it not works.
public static PacketContainer PLAYER_SLEEPING(Location loc, int entityId) {
PacketContainer packet = ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.BED);
packet.getIntegers().write(0, entityId);
packet.getBlockPositionModifier().write(0, new BlockPosition(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()));
return packet;
}
As you may have noticed versions 1.8 -1.12 are not supported, why?
Because from 1.13 it is possible to set the pose of the npc to SLEEPING.
In previous versions instead you have to use a PacketPlayOutBed, which causes problems.
Using this code I can make him sleep, however I cannot make the bed invisible.
Preview Result
As you can see in the image the npc skin is not visible, why? because in this version(1.8.8) a ClassNotFoundException is thrown referring to the Guava MultiMap.
The solution is * not * to import the entire library as it weighs 3MB.
The text was updated successfully, but these errors were encountered: