#Particles
1 messages · Page 1 of 1 (latest)
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!(sender instanceof Player)) return true;
new BukkitRunnable() {
Player player = (Player) sender;
Location loc = player.getLocation();
Vector direction = player.getEyeLocation().getdirection();
int lifeSpan = 20;
@Override
public void run() {
loc.add(direction);
player.spawnParticle(Particle.FLAME, loc, 1, 0, 0, 0, 0);
lifeSpan--;
if (lifeSpan == 0 ) this.cancel();
}
}.runTaskTimer(plugin, 0, 5);
return true;
}```
woah
didnt think you would send me all the code directly
thanks
still confused as to how i would run the command
it runs it for me?
executes it and repeats the run() method every 4 ticks
oh do i do this getCommand("shoot").setExecutor(new SpellCommand());
alright
in my main
after 20 loops it cancels itself
so the moment I reload it does it
it would do it whenever you execute whatever command you have registered
ok
testing now
woah
thats pretty cool
exactly what i wanted
how would i go about speeding it up
lowering the period?
change teh 5 to a 4 or less
a;right
as low as 1
its coming from my feet for some reason
where do you want it to come from?
yeah thats what i did
thanks
np
how would i go about spacing it out more
or making it less spaced out
@slim plume
sorry for ping it just said you left thread
increase teh vector you add each time
Vector direction = player.getEyeLocation().getdirection().multiply(1.5);```
Vector direction = player.getEyeLocation().getDirection().multiply(#);
oh
yeah that works
how do you do that box thing
to type code
three back ticks `
does that work anywhere or just this server
all discord
theres other tag, java, xml, yaml