Ir para conteúdo
  • 0

[Resolvido] [Duvida] - Codding plugin :3


ΔŘŦĦỮŘǤỮƗ

Pergunta

19 respostass a esta questão

Posts Recomendados

Pra nao precisa duplicar código e tals

int[][] offsets = {{-6, 0, 0}, {6, 0, 0}, {0, 0, -6}, {0, 0, 6}};

for( int i = 0; i < offsets.length; i++ )
{
    Firework F = (Firework) e.getPlayer().getWorld().spawn(e.getPlayer().getLocation().add(offsets[i][0], offsets[i][1], offsets[i][2]), Firework.class);
    FireworkMeta FM = F.getFireworkMeta();
    FM.addEffect(FireworkEffect.builder().flicker(false).trail(false).with(Type.BALL).withColor(Color.RED).withFade(Color.BLUE).build());                
    FM.setPower(this.plugin.getConfig().getInt("Potencia"));
    F.setFireworkMeta(FM);
}
Editado por leonardosc
Link para o comentário
Compartilhar em outros sites

Galera como faço para um foguete spawnar ao redor do player ?

 

Tipo ... 

1 de frente

1 atras

1 do lado esquerdo

1 do lado direito 

 

:) e como coloco os efeitos no foguete

Quantos Blocos de distancia do player para estes lados ?

Link para o comentário
Compartilhar em outros sites

player.getLocation().add(6, 0, 0).fazAlgumaCoisa();

player.getLocation().add(-6, 0, 0).fazAlgumaCoisa();

player.getLocation().add(0, 0, 6).fazAlgumaCoisa();

player.getLocation().add(0, 0, -6).fazAlgumaCoisa();

 

Ta foda de responder com esse forum todo bugado... sem comentarios.

Editado por leonardosc
Link para o comentário
Compartilhar em outros sites

player.getLocation().add(6, 0, 0).fazAlgumaCoisa();

player.getLocation().add(-6, 0, 0).fazAlgumaCoisa();

player.getLocation().add(0, 0, 6).fazAlgumaCoisa();

player.getLocation().add(0, 0, -6).fazAlgumaCoisa();

 

Ta foda de responder com esse forum todo bugado... sem comentarios.

é ... verdade ta muito dificil o forum bugado...

 

@Topic

 

Ta ... mais como faço esse codigo poder ser usado no fazAlgumaCoisa ?

FM.addEffect(FireworkEffect.builder().flicker(false).trail(false).with(Type.BALL).withColor(Color.RED).withFade(Color.BLUE).build());

Ex: transformar essa parte toda em apenas um Lancarfoguete() '-' acho que ficaria mais facil ... é possivel ?

Editado por ΔŘŦĦỮŘǤỮƗ
Link para o comentário
Compartilhar em outros sites

é ... verdade ta muito dificil o forum bugado...

 

@Topic

 

Ta ... mais como faço esse codigo poder ser usado no fazAlgumaCoisa ?

FM.addEffect(FireworkEffect.builder().flicker(false).trail(false).with(Type.BALL).withColor(Color.RED).withFade(Color.BLUE).build());

Ex: transformar essa parte toda em apenas um Lancarfoguete() '-' acho que ficaria mais facil ... é possivel ?

Não tem vendo em nenhum lugar um argumento pra localização...

 

Como que funciona essa sua classe FM?

Link para o comentário
Compartilhar em outros sites

Não tem vendo em nenhum lugar um argumento pra localização...

 

Como que funciona essa sua classe FM?

Firework F = (Firework) e.getPlayer().getWorld().spawn(e.getPlayer().getLocation(), Firework.class);
FireworkMeta FM = F.getFireworkMeta();
FM.addEffect(FireworkEffect.builder().flicker(false).trail(false).with(Type.BALL).withColor(Color.RED).withFade(Color.BLUE).build());				
FM.setPower(this.plugin.getConfig().getInt("Potencia"));
F.setFireworkMeta(FM);
Link para o comentário
Compartilhar em outros sites

Firework F = (Firework) e.getPlayer().getWorld().spawn(e.getPlayer().getLocation(), Firework.class);
FireworkMeta FM = F.getFireworkMeta();
FM.addEffect(FireworkEffect.builder().flicker(false).trail(false).with(Type.BALL).withColor(Color.RED).withFade(Color.BLUE).build());				
FM.setPower(this.plugin.getConfig().getInt("Potencia"));
F.setFireworkMeta(FM);

 

 

                                                                                        \/
Firework F1 = (Firework) e.getPlayer().getWorld().spawn(e.getPlayer().getLocation().add(6, 0, 0), Firework.class);
FireworkMeta FM1 = F1.getFireworkMeta();
FM1.addEffect(FireworkEffect.builder().flicker(false).trail(false).with(Type.BALL).withColor(Color.RED).withFade(Color.BLUE).build());				
FM1.setPower(this.plugin.getConfig().getInt("Potencia"));
F1.setFireworkMeta(FM1);

                                                                                        \/
Firework F2 = (Firework) e.getPlayer().getWorld().spawn(e.getPlayer().getLocation().add(-6, 0, 0), Firework.class);
FireworkMeta FM2 = F2.getFireworkMeta();
FM2.addEffect(FireworkEffect.builder().flicker(false).trail(false).with(Type.BALL).withColor(Color.RED).withFade(Color.BLUE).build());				
FM2.setPower(this.plugin.getConfig().getInt("Potencia"));
F2.setFireworkMeta(FM2);

                                                                                        \/
Firework F3 = (Firework) e.getPlayer().getWorld().spawn(e.getPlayer().getLocation().add(0,0,6), Firework.class);
FireworkMeta FM3 = F3.getFireworkMeta();
FM3.addEffect(FireworkEffect.builder().flicker(false).trail(false).with(Type.BALL).withColor(Color.RED).withFade(Color.BLUE).build());				
FM3.setPower(this.plugin.getConfig().getInt("Potencia"));
F3.setFireworkMeta(FM3);

                                                                                        \/
Firework F4 = (Firework) e.getPlayer().getWorld().spawn(e.getPlayer().getLocation().add(0,0,-6), Firework.class);
FireworkMeta FM4 = F4.getFireworkMeta();
FM4.addEffect(FireworkEffect.builder().flicker(false).trail(false).with(Type.BALL).withColor(Color.RED).withFade(Color.BLUE).build());				
FM4.setPower(this.plugin.getConfig().getInt("Potencia"));
F4.setFireworkMeta(FM4); 

 

 

Link para o comentário
Compartilhar em outros sites

 

Pra nao precisa duplicar código e tals

int[][] offsets = {{-6, 0, 0}, {6, 0, 0}, {0, 0, -6}, {0, 0, 6}};

for( int i = 0; i < offsets.length; i++ )
{
    Firework F = (Firework) e.getPlayer().getWorld().spawn(e.getPlayer().getLocation().add(offsets[i][0], offsets[i][1], offsets[i][2]), Firework.class);
    FireworkMeta FM = F.getFireworkMeta();
    FM.addEffect(FireworkEffect.builder().flicker(false).trail(false).with(Type.BALL).withColor(Color.RED).withFade(Color.BLUE).build());                
    FM.setPower(this.plugin.getConfig().getInt("Potencia"));
    F.setFireworkMeta(FM);
}

Ele não vai entender

Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...