From 9b061317a7a02a704a794667f96ffb8dbb7255f2 Mon Sep 17 00:00:00 2001 From: Luca Date: Wed, 24 Nov 2021 20:58:37 +0100 Subject: [PATCH] Update RandomListeners.java --- .../java/rip/tilly/bedwars/listeners/RandomListeners.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/rip/tilly/bedwars/listeners/RandomListeners.java b/src/main/java/rip/tilly/bedwars/listeners/RandomListeners.java index e4ddc1f..4f9687c 100644 --- a/src/main/java/rip/tilly/bedwars/listeners/RandomListeners.java +++ b/src/main/java/rip/tilly/bedwars/listeners/RandomListeners.java @@ -1,5 +1,6 @@ package rip.tilly.bedwars.listeners; +import org.bukkit.GameMode; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; @@ -90,6 +91,10 @@ public class RandomListeners implements Listener { @EventHandler public void onInventoryClick(InventoryClickEvent event) { Player player = (Player) event.getWhoClicked(); + if (player.getGameMode() == GameMode.CREATIVE) { + return; + } + PlayerData playerData = this.plugin.getPlayerDataManager().getPlayerData(player.getUniqueId()); if (playerData.getPlayerState() != PlayerState.PLAYING) { event.setCancelled(true);