diff --git a/src/main/java/world/bentobox/bentobox/api/panels/builders/PanelBuilder.java b/src/main/java/world/bentobox/bentobox/api/panels/builders/PanelBuilder.java index 6234542cb..424129b88 100644 --- a/src/main/java/world/bentobox/bentobox/api/panels/builders/PanelBuilder.java +++ b/src/main/java/world/bentobox/bentobox/api/panels/builders/PanelBuilder.java @@ -94,6 +94,7 @@ public class PanelBuilder { * @return Panel */ public Panel build() { - return new Panel(name, items, Math.max(size, items.isEmpty() ? size : items.lastKey()), user, listener); + // items.lastKey() is a slot position, so the panel size is this value + 1 + return new Panel(name, items, Math.max(size, items.isEmpty() ? size : items.lastKey() + 1), user, listener); } }