use of org.bukkit.event.entity.ExpBottleEvent in project Glowstone by GlowstoneMC.
the class GlowThrownExpBottle method spawnOrb.
private void spawnOrb() {
int xp = ThreadLocalRandom.current().nextInt(9) + 3;
ExpBottleEvent event = EventFactory.getInstance().callEvent(new ExpBottleEvent(this, xp));
xp = event.getExperience();
// TODO: Show effect
ExperienceOrb orb = (ExperienceOrb) world.spawnEntity(location, EntityType.EXPERIENCE_ORB);
orb.setExperience(xp);
if (orb instanceof GlowExperienceOrb) {
((GlowExperienceOrb) orb).setFromBottle(true);
}
remove();
}
Aggregations