I have a Question : How do you make some sort of QuakeCraft like Animation with the hoe i mean the particles but i want it so it will do every 5 ticks the next block so like PARTICLE - 5 ticks - PARTICLE - 5 ticks - PARTICLE - 5 ticks - BOOM! EXPLODEPARTICLES! I know how to make Particles and how to do with the hoe but how do i make that animation?
int count = 3; Then create a scheduler that will spawn particles and do count-- every 5 ticks, then if count == 0, make boom and stop scheduler.
I think you dont understeand me? I want the Locations of the blocks from the player to the targetted block
Norbu10 Launch a projectile, every 2-3 ticks play an effect at the projectile and on projectile hit just spawn an explosion.
Norbu10 Use a BlockIterator: Code:java public List<Location> locationsLOS(String p, int d) { // String p = Player name (not UUID); int d = Distance BlockIterator losbl = new BlockIterator(Bukkit.getServer().getPlayer(p), d); Block lastb = losbl.next(); List<Location> los = new ArrayList<Location>(); while (losbl.hasNext()) { lastb = losbl.next(); if (lastb.getType() == Material.AIR) { los.add(lastb.getLocation()); continue; } else { break; } } return los; } It returns a List of Locations from the player to the targetted block From my unfinished API.
How can i use it in this code and how can i activate it ? Code:java @EventHandler public void HandGun(final PlayerInteractEvent e) { if(e.getAction() == Action.RIGHT_CLICK_AIR || e.getAction() == Action.RIGHT_CLICK_BLOCK) { Player p = e.getPlayer(); if(p.getItemInHand().getType() == Material.IRON_HOE) { if (gunner.contains(p.getName())) { if (handgun.contains(p.getName())) { p.playSound(p.getLocation(), Sound.EXPLODE, 200, 3); Ammo(p); handgun.remove(p.getName()); } } } } }
Norbu10 Code:java List<Location> blocksInLineOfSight = locationsLOS(e.getPlayer().getName(), 32);for (Location block : blocksInLineOfSight) { // now "block" is a location in the blocksInLineOfSight List // you can do with it what you can do with every other location .getBlock() .getX() etc}
You can check sources of my plugin Laser: https://github.com/fromgate/Laser/blob/master/src/me/fromgate/laser/LaserGun.java#L196-L211