LaserBeam

Discussion in 'Plugin Development' started by Norbu10, Mar 18, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    Norbu10

    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?
     
  2. Offline

    StealerSlain

    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.
     
  3. Offline

    Norbu10

    I think you dont understeand me? I want the Locations of the blocks from the player to the targetted block
     
  4. Offline

    Norbu10

    Bumpy Dumb
     
  5. Offline

    SuperOmegaCow

    Norbu10
    Launch a projectile, every 2-3 ticks play an effect at the projectile and on projectile hit just spawn an explosion.
     
  6. Offline

    GameplayJDK

    Norbu10
    Use a BlockIterator:
    Code:java
    1.  
    2. public List<Location> locationsLOS(String p, int d) { // String p = Player name (not UUID); int d = Distance
    3. BlockIterator losbl = new BlockIterator(Bukkit.getServer().getPlayer(p), d);
    4. Block lastb = losbl.next();
    5. List<Location> los = new ArrayList<Location>();
    6. while (losbl.hasNext()) {
    7. lastb = losbl.next();
    8. if (lastb.getType() == Material.AIR) {
    9. los.add(lastb.getLocation());
    10. continue;
    11. } else {
    12. break;
    13. }
    14. }
    15. return los;
    16. }
    17.  

    It returns a List of Locations from the player to the targetted block
    From my unfinished API.
     
    Norbu10 likes this.
  7. Offline

    Norbu10

    How can i use it in this code and how can i activate it ?
    Code:java
    1. @EventHandler
    2. public void HandGun(final PlayerInteractEvent e) {
    3. if(e.getAction() == Action.RIGHT_CLICK_AIR || e.getAction() == Action.RIGHT_CLICK_BLOCK) {
    4. Player p = e.getPlayer();
    5. if(p.getItemInHand().getType() == Material.IRON_HOE) {
    6. if (gunner.contains(p.getName())) {
    7. if (handgun.contains(p.getName())) {
    8. p.playSound(p.getLocation(), Sound.EXPLODE, 200, 3);
    9. Ammo(p);
    10. handgun.remove(p.getName());
    11.  
    12. }
    13. }
    14. }
    15. }
    16. }
     
  8. Offline

    GameplayJDK

    Norbu10
    Code:java
    1. List<Location> blocksInLineOfSight = locationsLOS(e.getPlayer().getName(), 32);
    2. for (Location block : blocksInLineOfSight) {
    3. // now "block" is a location in the blocksInLineOfSight List
    4. // you can do with it what you can do with every other location .getBlock() .getX() etc
    5. }
     
  9. Offline

    fromgate

Thread Status:
Not open for further replies.

Share This Page