Advertisement
Guest User

Effect tutotial

a guest
Mar 22nd, 2014
1,032
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.04 KB | None | 0 0
  1. Step 1: Import BukkitGames.
  2. Step 2: Add the following to your code:
  3. public static me.Markcreator.SurvivalGames.Main api = null;
  4. In the onEnable():
  5. api = (me.Markcreator.SurvivalGames.Main) Bukkit.getPluginManager().getPlugin("BukkitGames");
  6. Step 3:
  7. Make your effect! Here is an example:
  8. @EventHandler
  9.     public void onBlockBreak(BlockBreakEvent event) {
  10.         Player player = event.getPlayer();
  11.        
  12.         if(api.started) {
  13.             if(api.livingPlayers.contains(player)) {
  14.                 if(api.el.playerKitEffect(player, "woodcutter")) {
  15.                     Block block = event.getBlock();
  16.                    
  17.                     if(block.getType() == Material.LOG) {
  18.                         destroyAllWood(block);
  19.                     }
  20.                 }
  21.             }
  22.         }
  23.     }
  24.    
  25.     public void destroyAllWood(Block block) {
  26.         block.breakNaturally();
  27.        
  28.         if(block.getLocation().getBlock().getRelative(0, 1, 0).getType() == Material.LOG) {
  29.             destroyAllWood(block.getLocation().getBlock().getRelative(0, 1, 0));
  30.         }
  31.     }
  32.  
  33. Now if you use the 'woodcutter' effect in a BukkitGames kit that kit will be able to chop a tree down with breaking just one block!
  34. Have fun!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement