Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Step 1: Import BukkitGames.
- Step 2: Add the following to your code:
- public static me.Markcreator.SurvivalGames.Main api = null;
- In the onEnable():
- api = (me.Markcreator.SurvivalGames.Main) Bukkit.getPluginManager().getPlugin("BukkitGames");
- Step 3:
- Make your effect! Here is an example:
- @EventHandler
- public void onBlockBreak(BlockBreakEvent event) {
- Player player = event.getPlayer();
- if(api.started) {
- if(api.livingPlayers.contains(player)) {
- if(api.el.playerKitEffect(player, "woodcutter")) {
- Block block = event.getBlock();
- if(block.getType() == Material.LOG) {
- destroyAllWood(block);
- }
- }
- }
- }
- }
- public void destroyAllWood(Block block) {
- block.breakNaturally();
- if(block.getLocation().getBlock().getRelative(0, 1, 0).getType() == Material.LOG) {
- destroyAllWood(block.getLocation().getBlock().getRelative(0, 1, 0));
- }
- }
- 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!
- Have fun!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement