Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //=============//
- //MAIN CLASS //
- //CrouchJump //
- //=============//
- package me.charcoal_inc;
- import org.bukkit.plugin.java.JavaPlugin;
- public class CrouchJump extends JavaPlugin {
- @Override
- public void onEnable() {
- getLogger().info("[CrouchJump] CrouchJump enabled! Jump away!");
- new PlayerListener(this);
- }
- @Override
- public void onDisable() {
- getLogger().info("[CrouchJump] CrouchJump disabled! No more bouncy. :(");
- }
- }
- //===============//
- //PlayerListener //
- //===============//
- package me.charcoal_inc;
- import org.bukkit.entity.Player;
- import org.bukkit.event.EventHandler;
- import org.bukkit.event.Listener;
- import org.bukkit.event.player.PlayerToggleSneakEvent;
- import org.bukkit.potion.PotionEffect;
- import org.bukkit.potion.PotionEffectType;
- public class PlayerListener implements Listener {
- public PlayerListener(CrouchJump plugin) {
- plugin.getServer().getPluginManager().registerEvents(this, plugin);
- }
- @EventHandler
- public void jumpPrep(PlayerToggleSneakEvent e) {
- Player player = e.getPlayer();
- if (player.isSneaking())
- player.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 20, 2));
- }
- }
- //===========//
- //plugin.yml //
- //===========//
- name: CrouchJump
- main: me.charcoal_inc.CrouchJump
- version: 1.0
Advertisement
Add Comment
Please, Sign In to add comment