Vinetos

CREER UN PLUGIN BUKKIT #25 - Les Effets

Apr 14th, 2015
447
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. import org.bukkit.entity.Player;
  2. import org.bukkit.event.EventHandler;
  3. import org.bukkit.event.Listener;
  4. import org.bukkit.event.player.PlayerJoinEvent;
  5. import org.bukkit.plugin.java.JavaPlugin;
  6. import org.bukkit.potion.PotionEffect;
  7. import org.bukkit.potion.PotionEffectType;
  8.  
  9. public class Main extends JavaPlugin implements Listener{
  10.  
  11.  
  12. @Override
  13. public void onEnable() {
  14. getServer().getPluginManager().registerEvents(this, this);
  15. }
  16.  
  17. @EventHandler
  18. public void onJoin(PlayerJoinEvent e){
  19. Player p = e.getPlayer();
  20. //1 Seconde = 20 tick
  21. // Type de l'effect, Temps, Puissance - 1
  22. PotionEffect pej = new PotionEffect(PotionEffectType.JUMP, 400, 4);
  23. PotionEffect pes = new PotionEffect(PotionEffectType.SPEED, 400, 5);
  24. p.addPotionEffect(pej);
  25. p.addPotionEffect(pes);
  26.  
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment