Advertisement
Guest User

PluginHelp

a guest
Feb 6th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. package me.heronetwork;
  2.  
  3. import com.rit.sucy.CustomEnchantment;
  4. import com.rit.sucy.EnchantmentAPI;
  5.  
  6. public class Main extends CustomEnchantment {
  7.  
  8. public void onEnable() {
  9. }
  10.  
  11. public void onDisable() {
  12. }
  13.  
  14. public void registerEnchantments() {
  15. }
  16.  
  17. }
  18.  
  19.  
  20. package me.heronetwork;
  21.  
  22. import org.bukkit.Material;
  23. import org.bukkit.block.Block;
  24. import org.bukkit.entity.Player;
  25. import org.bukkit.event.block.BlockEvent;
  26. import org.bukkit.potion.PotionEffect;
  27. import org.bukkit.potion.PotionEffectType;
  28.  
  29. import com.rit.sucy.CustomEnchantment;
  30.  
  31. public class SpeedEnchant extends CustomEnchantment {
  32.  
  33. static final Material[] ITEMS = new Material[] {
  34. Material.WOOD_PICKAXE, Material.STONE_PICKAXE,
  35. Material.IRON_PICKAXE, Material.GOLD_PICKAXE,
  36. Material.DIAMOND_PICKAXE };
  37.  
  38. public SpeedEnchant() {
  39. super("Speed", ITEMS, 2);
  40. this.max = 3;
  41. this.base = 10;
  42. this.interval = 10;
  43. }
  44.  
  45. public void applyToolEffect(Player player, Block block, int enchantlevel, BlockEvent event) {
  46. player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 3, enchantlevel));
  47. }
  48.  
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement