prevent players in creative mode from breaking the sentry disguise block
@@ -304,6 +304,14 @@ public class SCEventHandler {
BlockEntityTracker.BLOCK_CHANGE_DETECTOR.getBlockEntitiesInRange(level, pos).forEach(detector -> detector.log(player, DetectionMode.BREAK, pos, state));
}
+
+ //don't let players in creative mode break the disguise block. it's not possible to break it in other gamemodes
+ if (event.getPlayer().isCreative()) {
+ List<Sentry> sentries = level.getEntitiesOfClass(Sentry.class, new AABB(event.getPos()));
+
+ if (!sentries.isEmpty())
+ event.setCanceled(true);
+ }
}
@SubscribeEvent
