Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Entity item = e.getPlayer().getWorld().dropItemNaturally(e.getPlayer().getLocation().add(0.0D, 1.3D, 0.0D), ceggItem.getItem());
- if (e.getPlayer().getItemInHand().getAmount() == 1) {
- e.getPlayer().setItemInHand(null);
- } else {
- e.getPlayer().getItemInHand().setAmount(e.getPlayer().getItemInHand().getAmount() - 1);
- }
- double pitch = (e.getPlayer().getLocation().getPitch() + 90.0F) * 3.141592653589793D / 180.0D;
- double yaw = (e.getPlayer().getLocation().getYaw() + 90.0F) * 3.141592653589793D / 180.0D;
- double x = Math.sin(pitch) * Math.cos(yaw);
- double y = Math.sin(pitch) * Math.sin(yaw);
- double z = Math.cos(pitch);
- Vector vector = new Vector(x, z, y);
- item.setVelocity(vector);
- new BukkitRunnable() {
- @Override
- public void run() {
- item.remove();
- e.getPlayer().getWorld().createExplosion(item.getLocation(), 3);
- }
- }.runTaskLater(RageFactions.p, 20L * RageFactions.p.getConfig().getInt("throwable-creepereggs.explode-after"));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement