    public void onPlayerInteract(PlayerInteractEvent event) {
        if (event.getAction() != Action.LEFT_CLICK_BLOCK && event.getAction() != Action.RIGHT_CLICK_BLOCK) {
            return;
        }
        if (event.getPlayer().getItemInHand().getType().equals(Material.BONE)) {
            if (!UtilPermissions.playerCanUseCommand(event.getPlayer(), "castaway.admin")) {
                PlayerUtils.sendError(event.getPlayer(), CastAwayCore.NAME, "You are not allowed to do this!");
                event.setCancelled(true);
                return;
            }
            event.setCancelled(true);
            event.setUseInteractedBlock(Event.Result.DENY);
            event.setUseItemInHand(Event.Result.DENY);
            Player player = event.getPlayer();
            boolean isLeftClick = (event.getAction() == Action.LEFT_CLICK_BLOCK);
            if (player.isSneaking()) {
                Dungeon dungeon = CastAwayCore.gameManager.getDungeonByName("test");
                if (dungeon != null) {
                    if (isLeftClick && event.getClickedBlock().getType().equals(Material.STONE_PLATE)) {
                        AbstractBlock actionBlock = new DungeonStartBlock(new BlockVector(event.getClickedBlock()), dungeon);
                        if (CastAwayCore.databaseManager.addActionBlock(actionBlock)) {
                            CastAwayCore.databaseManager.addActionBlock(actionBlock);
                            CastAwayCore.gameManager.addBlock(actionBlock.getVector(), actionBlock);
                            PlayerUtils.sendSuccess(event.getPlayer(), CastAwayCore.NAME, "Start block added for '" + dungeon.getDungeonName() + "'.");
                        } else {
                            PlayerUtils.sendError(event.getPlayer(), CastAwayCore.NAME, "Error creating block in database!");
                        }
                    } else if (!isLeftClick && event.getClickedBlock().getType().equals(Material.STONE_BUTTON)) {
                        AbstractBlock actionBlock = new DungeonEndBlock(new BlockVector(event.getClickedBlock()), dungeon);
                        if (CastAwayCore.databaseManager.addActionBlock(actionBlock)) {
                            CastAwayCore.gameManager.addBlock(actionBlock.getVector(), actionBlock);
                            PlayerUtils.sendSuccess(event.getPlayer(), CastAwayCore.NAME, "End block added for '" + dungeon.getDungeonName() + "'.");
                        } else {
                            PlayerUtils.sendError(event.getPlayer(), CastAwayCore.NAME, "Error creating block in database!");
                        }
                    }
                }
            } else {
                PlayerUtils.sendError(event.getPlayer(), CastAwayCore.NAME, "Dungeon 'test' not found!");
            }
        }
    }

    public void onPlayerInteract(PlayerInteractEvent event) {
        if (event.getAction() != Action.LEFT_CLICK_BLOCK && event.getAction() != Action.RIGHT_CLICK_BLOCK) {
            return;
        }
        if (event.getPlayer().getItemInHand().getType().equals(Material.BONE)) {
            if (!UtilPermissions.playerCanUseCommand(event.getPlayer(), "castaway.admin")) {
                PlayerUtils.sendError(event.getPlayer(), CastAwayCore.NAME, "You are not allowed to do this!");
                event.setCancelled(true);
                return;
            }
            event.setCancelled(true);
            event.setUseInteractedBlock(Event.Result.DENY);
            event.setUseItemInHand(Event.Result.DENY);
            Player player = event.getPlayer();
            boolean isLeftClick = (event.getAction() == Action.LEFT_CLICK_BLOCK);
            if (player.isSneaking()) {
                Dungeon dungeon = CastAwayCore.gameManager.getDungeonByName("test");
                if (dungeon != null) {
                    if (isLeftClick && event.getClickedBlock().getType().equals(Material.STONE_PLATE)) {
                        AbstractBlock actionBlock = new DungeonStartBlock(new BlockVector(event.getClickedBlock()), dungeon);
                        if (CastAwayCore.databaseManager.addActionBlock(actionBlock)) {
                            CastAwayCore.databaseManager.addActionBlock(actionBlock);
                            CastAwayCore.gameManager.addBlock(actionBlock.getVector(), actionBlock);
                            PlayerUtils.sendSuccess(event.getPlayer(), CastAwayCore.NAME, "Start block added for '" + dungeon.getDungeonName() + "'.");
                        } else {
                            PlayerUtils.sendError(event.getPlayer(), CastAwayCore.NAME, "Error creating block in database!");
                        }
                    } else if (!isLeftClick && event.getClickedBlock().getType().equals(Material.STONE_BUTTON)) {
                        AbstractBlock actionBlock = new DungeonEndBlock(new BlockVector(event.getClickedBlock()), dungeon);
                        if (CastAwayCore.databaseManager.addActionBlock(actionBlock)) {
                            CastAwayCore.gameManager.addBlock(actionBlock.getVector(), actionBlock);
                            PlayerUtils.sendSuccess(event.getPlayer(), CastAwayCore.NAME, "End block added for '" + dungeon.getDungeonName() + "'.");
                        } else {
                            PlayerUtils.sendError(event.getPlayer(), CastAwayCore.NAME, "Error creating block in database!");
                        }
                    }
                } else {
                    PlayerUtils.sendError(event.getPlayer(), CastAwayCore.NAME, "Dungeon 'test' not found!");
                }
            }
        }
    }
