Enderpearl Packet

Discussion in 'Plugin Development' started by Irantwomiles, Jun 22, 2016.

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

    Irantwomiles

    Is there a specific packet that I have to disable for players to allow ender pearls to go through players? I've been looking for this for a while. Specifically I want to make it so if someone is vanished they can't block ender pearls of visible people.
     
  2. Offline

    Zombie_Striker

    @Irantwomiles
    No. That is calculated internally. You would have to edit the bit of code inside the bukkit jar that does the collision checks for ender pearls.
     
  3. Offline

    Irantwomiles

    Well there a lot of plugins out there that stop projectiles from hitting people, for example if a player is spectating they shouldn't interfere with the game, how do they stop such events?

    EDIT: Someone on the spigot forums showed me this but I'm not really sure how to use it.
    EDIT: that is only for living entities so nvm.
     
    Last edited: Jun 22, 2016
  4. Offline

    Zombie_Striker

    @Irantwomiles
    Player does extend LivingEntity, so this should work. Try it.
     
  5. Offline

    Irantwomiles

    this is what I'm trying but the #setCollision() is not working
    Code:
        public void onHit(EntityDamageByEntityEvent event) {
            if(event.getDamager() instanceof EnderPearl && event.getEntity() instanceof Player) {
                Entity enderPearl = event.getDamager();
                LivingEntity player = (Player) event.getEntity();
              
            }
        }
    
    EDIT: umm I think setCollidable is only for 1.9 or what ever version that allows you to push players and I'm working on 1.7.x /1.8.x
     
Thread Status:
Not open for further replies.

Share This Page