From 64f9dff6effae1226b6b6249915395234032aebe Mon Sep 17 00:00:00 2001 From: MeFisto94 Date: Fri, 28 Aug 2020 01:41:31 +0200 Subject: [PATCH] Expose the Entity Counter to allow plugins to use valid and non-conflicting Entity Ids --- paper-api/src/main/java/org/bukkit/UnsafeValues.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/UnsafeValues.java b/paper-api/src/main/java/org/bukkit/UnsafeValues.java index 739f117a0f..bd3567e9b0 100644 --- a/paper-api/src/main/java/org/bukkit/UnsafeValues.java +++ b/paper-api/src/main/java/org/bukkit/UnsafeValues.java @@ -168,5 +168,12 @@ public interface UnsafeValues { byte[] serializeItem(ItemStack item); ItemStack deserializeItem(byte[] data); + + /** + * Creates and returns the next EntityId available. + *

+ * Use this when sending custom packets, so that there are no collisions on the client or server. + */ + public int nextEntityId(); // Paper end }