How can ender pearl cool down be disabled? [1.9]

Discussion in 'Plugin Development' started by Lazini, Mar 24, 2016.

Thread Status:
Not open for further replies.
  1. Offline

    Lazini

    Hello everyone, I have a question.

    Is there any way to disable the ender pearl cool down that was introduced in 1.9? It affects negatively the way EnderSurfer, my plugin, works.

    I thought about using attributes, but the generic.attackSpeed affects only the player's attack strength (based on the time passed after the last swing and what not).

    Thanks in advance,

    Lazini.
     
  2. Offline

    jusjus112

    @Lazini
    Can't you just add a custom cooldown? Its much simpeler ;)
     
  3. Offline

    Lazini

    I don't want to add a cool down, I want to disable the existing one. But I fear that it has been hardcoded now into the game, and it cannot be controlled by the server, hence by any plugin..

    Thoughts?
     
  4. Offline

    jusjus112

    @Lazini
    Oke, i see.

    Why you can't do. If you right click a enderpearl, shoot a enderpearl? And cancel the event.?

    This is from one of my plugins:
    Code:
        @EventHandler
        public void onPlayerShoot(PlayerInteractEvent e) {
            if (e.getAction().equals(Action.RIGHT_CLICK_AIR)) { //Check if right click air. So the player wont be shoot @ a block
                if (e.getItem().getType() == Material.ENDER_PEARL) { //Of course it must be an enderpearl
                    e.setCancelled(true); //Don't shoot 2 enderpearls!
                    EnderPearl ep = e.getPlayer().launchProjectile(EnderPearl.class); //Shoot the enderpearl
                    ep.setVelocity(e.getPlayer().getEyeLocation().getDirection()); //Set the direction the player is looking
                }
            }
        }
     
    WolfMage1 likes this.
  5. Offline

    mcdorli

    Please don't spoonfeed code, you do more harm with it than good.
     
  6. Offline

    Lazini

    So you're basically simulating an ender pearl throw, but doing it manually to avoid the cool down? And this works properly? (About to test now)
     
  7. Offline

    mcdorli

    Yes, it should
     
Thread Status:
Not open for further replies.

Share This Page