9
0
mirror of https://github.com/GeyserExtensionists/GeyserUtils.git synced 2025-12-19 15:09:24 +00:00

custom entity

This commit is contained in:
zimzaza4
2024-04-20 13:26:46 +08:00
parent 48389f2fbf
commit 6537d6f247
3 changed files with 29 additions and 19 deletions

View File

@@ -61,7 +61,18 @@ public class PlayerUtils {
}
public static void sendCustomHitBox(Player player, Entity entity, float height, float width) {
CustomHitBoxPacket packet = new CustomHitBoxPacket(entity.getEntityId(), height, width);
CustomEntityDataPacket packet = new CustomEntityDataPacket();
packet.setEntityId(entity.getEntityId());
packet.setWidth(width);
packet.setHeight(height);
player.sendPluginMessage(GeyserUtils.getInstance(), GeyserUtilsChannels.MAIN, GeyserUtils.getPacketManager().encodePacket(packet));
}
public static void sendCustomScale(Player player, Entity entity, float scale) {
CustomEntityDataPacket packet = new CustomEntityDataPacket();
packet.setEntityId(entity.getEntityId());
packet.setScale(scale);
player.sendPluginMessage(GeyserUtils.getInstance(), GeyserUtilsChannels.MAIN, GeyserUtils.getPacketManager().encodePacket(packet));
}