Package org.bukkit.entity

Examples of org.bukkit.entity.ExperienceOrb


    }

    @Override
    public boolean spawn(Location weLoc) {
        org.bukkit.Location loc = BukkitUtil.toLocation(weLoc);
        ExperienceOrb orb = loc.getWorld().spawn(loc, ExperienceOrb.class);
        if (orb != null) {
            orb.setExperience(amount);
            return true;
        }
        return false;
    }
View Full Code Here


    public void trigger (ChipState chip) {

        if(chip.getInput(0)) {

            for(int i = 0; i < orbs; i++) {
                ExperienceOrb orb = getLocation().getWorld().spawn(getLocation().add(0.5, 1.5, 0.5), ExperienceOrb.class);
                orb.setExperience(amount);
            }
        }
    }
View Full Code Here

  }
 
  @Override
  @Nullable
  public ExperienceOrb spawn(final Location loc) {
    final ExperienceOrb orb = super.spawn(loc);
    if (orb == null)
      return null;
    if (xp == -1)
      orb.setExperience(1);
    return orb;
  }
View Full Code Here

    }
    for (final Location l : locations.getArray(e)) {
      final Location itemDropLoc = l.clone().subtract(0.5, 0.5, 0.5); // dropItemNaturally adds 0.15 to 0.85 randomly to all coordinates
      for (final Object o : os) {
        if (o instanceof Experience) {
          final ExperienceOrb orb = l.getWorld().spawn(l, ExperienceOrb.class);
          orb.setExperience(((Experience) o).getXP());
        } else {
          for (final ItemStack is : ((ItemType) o).getItem().getAll()) {
            if (is.getType() != Material.AIR)
              l.getWorld().dropItemNaturally(itemDropLoc, is);
          }
View Full Code Here

TOP

Related Classes of org.bukkit.entity.ExperienceOrb

Copyright © 2018 www.massapicom. 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.