Package org.bukkit.entity

Examples of org.bukkit.entity.Player.playSound()


      return;
    }
    // Prevent thieves from taking their bomb/wool/cake into a chest, etc.
    if (zone.isThief(player.getName())) {
      event.setCancelled(true);
      player.playSound(player.getLocation(), Sound.FIZZ, 10, 10);
    } else // Magically give player a wool block when they click their helmet
      if (event.getSlotType() == InventoryType.SlotType.ARMOR && event.getSlot() == 39
        && zone.getWarzoneConfig().getBoolean(WarzoneConfig.BLOCKHEADS)) {
      ItemStack teamBlock = zone.getPlayerTeam(player.getName()).getKind().getBlockHead();
      player.getInventory().remove(teamBlock.getType());
View Full Code Here


    if (zone == null) {
      return;
    }
    if (zone.isImportantBlock(event.getBlockClicked())) {
      event.setCancelled(true);
      player.playSound(player.getLocation(), Sound.FIZZ, 10, 10);
    }
  }
}
View Full Code Here

        event.setCancelled(true);
        // Replace message with sound to reduce spamminess.
        // Whenever a player dies in the middle of conflict they will
        // likely respawn still trying to use their items to attack
        // another player.
        player.playSound(player.getLocation(), Sound.ITEM_BREAK, 1, 0);
      }

      if (zone != null && event.getAction() == Action.RIGHT_CLICK_BLOCK && event.getClickedBlock().getType() == Material.ENDER_CHEST && !zone.getWarzoneConfig().getBoolean(WarzoneConfig.ALLOWENDER)) {
        event.setCancelled(true);
        War.war.badMsg(player, "use.ender");
View Full Code Here

         * TREE FELLER SOUNDS
         *
         * We don't need to check permissions here because they've already been checked for the ability to even activate.
         */
        if (mcMMOPlayer.getAbilityMode(AbilityType.TREE_FELLER) && BlockUtils.isLog(blockState) && Config.getInstance().getTreeFellerSoundsEnabled()) {
            player.playSound(blockState.getLocation(), Sound.FIZZ, Misc.FIZZ_VOLUME, Misc.getFizzPitch());
        }
    }

    /**
     * Handle BlockDamage events where the event is modified.
View Full Code Here

            }
        }
        else if (mcMMOPlayer.getAbilityMode(AbilityType.BERSERK) && heldItem.getType() == Material.AIR) {
            if (AbilityType.BERSERK.blockCheck(block.getState()) && EventUtils.simulateBlockBreak(block, player, true)) {
                event.setInstaBreak(true);
                player.playSound(block.getLocation(), Sound.ITEM_PICKUP, Misc.POP_VOLUME, Misc.getPopPitch());
            }
            else if (mcMMOPlayer.getUnarmedManager().canUseBlockCracker() && BlockUtils.affectedByBlockCracker(blockState) && EventUtils.simulateBlockBreak(block, player, true)) {
                if (mcMMOPlayer.getUnarmedManager().blockCrackerCheck(blockState)) {
                    blockState.update();
                }
View Full Code Here

                }
            }
        }
        else if (mcMMOPlayer.getWoodcuttingManager().canUseLeafBlower(heldItem) && BlockUtils.isLeaves(blockState) && EventUtils.simulateBlockBreak(block, player, true)) {
            event.setInstaBreak(true);
            player.playSound(blockState.getLocation(), Sound.ITEM_PICKUP, Misc.POP_VOLUME, Misc.getPopPitch());
        }
    }
}
View Full Code Here

        if (Config.getInstance().getRepairAnvilMessagesEnabled()) {
            player.sendMessage(LocaleLoader.getString("Repair.Listener.Anvil"));
        }

        if (Config.getInstance().getRepairAnvilPlaceSoundsEnabled()) {
            player.playSound(player.getLocation(), Sound.ANVIL_LAND, Misc.ANVIL_USE_VOLUME, Misc.ANVIL_USE_PITCH);
        }

        togglePlacedAnvil();
    }
View Full Code Here

        // Give out XP like candy
        applyXpGain((float) ((getPercentageRepaired(startDurability, newDurability, repairable.getMaximumDurability()) * repairable.getXpMultiplier()) * ExperienceConfig.getInstance().getRepairXPBase() * ExperienceConfig.getInstance().getRepairXP(repairable.getRepairMaterialType())), XPGainReason.PVE);

        // BWONG BWONG BWONG
        if (Config.getInstance().getRepairAnvilUseSoundsEnabled()) {
            player.playSound(player.getLocation(), Sound.ANVIL_USE, Misc.ANVIL_USE_VOLUME, Misc.ANVIL_USE_PITCH);
        }

        // Repair the item!
        item.setDurability(newDurability);
    }
View Full Code Here

        if (!drop.hasMetadata(mcMMO.droppedItemKey) && mcMMOPlayer.inParty() && ItemUtils.isSharable(dropStack)) {
            event.setCancelled(ShareHandler.handleItemShare(drop, mcMMOPlayer));

            if (event.isCancelled()) {
                player.playSound(player.getLocation(), Sound.ITEM_PICKUP, Misc.POP_VOLUME, Misc.getPopPitch());
                return;
            }
        }

        if ((mcMMOPlayer.isUsingUnarmed() && ItemUtils.isSharable(dropStack)) || mcMMOPlayer.getAbilityMode(AbilityType.BERSERK)) {
View Full Code Here

            boolean pickupSuccess = Unarmed.handleItemPickup(player.getInventory(), drop);
            boolean cancel = Config.getInstance().getUnarmedItemPickupDisabled() || pickupSuccess;
            event.setCancelled(cancel);

            if (pickupSuccess) {
                player.playSound(player.getLocation(), Sound.ITEM_PICKUP, Misc.POP_VOLUME, Misc.getPopPitch());
                player.updateInventory();
                return;
            }
        }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.