Java Reference
In-Depth Information
For extra punch, I've added an effect on each block we traverse:
spawnParticle(b.getLocation(), Particle.Type.LAVASPARK);
The LAVASPARK gives us a nice set of sparks along our line of sight.
I've also added a sound effect, using the playSound helper function, which takes
a Location , and a Sound (and optionally floats for volume and pitch if you want).
playSound(b.getLocation(), SoundEffect.Type.EXPLODE);
There's a list of possible effects in the Canary documentation under . I picked EXPLODE for drama. (Option-
ally you can add the volume and pitch as two numbers after that; they are
specified to be float , not double , so remember to add the f modifier.)
Here's the full code, with the iterator and sound effect:
package lavavision;
import net.canarymod.plugin.Plugin;
import net.canarymod.logger.Logman;
import net.canarymod.Canary;
import net.canarymod.commandsys.*;
import net.canarymod.BlockIterator;
import net.canarymod.LineTracer;
import com.pragprog.ahmine.ez.EZPlugin;
public class LavaVision extends EZPlugin {
@Command(aliases = { "lavavision" },
description = "Explode your target into a ball of flaming lava" ,
permissions = { "" },
toolTip = "/lavavision" )
public void lavavisionCommand(MessageReceiver caller, String[] args) {
if (caller instanceof Player) {
Player me = (Player)caller;
BlockIterator sightItr = new BlockIterator( new LineTracer(me), true);
while (sightItr.hasNext()) {
Block b =;
spawnParticle(b.getLocation(), Particle.Type.LAVASPARK);
Search WWH ::

Custom Search