Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-6340

AreaEffectCloud getSource() returns null if shooter is dispenser

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • None
    • None
    • CraftBukkit version 2991-Spigot-018b9a0-f3f3094 (MC: 1.16.5) (Implementing API version 1.16.5-R0.1-SNAPSHOT)
    • Yes

       

      It seems like getSource() will return null from the AreaEffectCloud created by lingering potion fired from dispenser. getSource() should return a ProjectileSource, which should lead to the dispenser block.

      Test with this code:

      List<Entity> nearby = player.getNearbyEntities(32, 32, 32); 
      for (Entity entity : nearby) { 
          if (entity instanceof AreaEffectCloud) { 
              AreaEffectCloud area = (AreaEffectCloud) entity; 
              player.sendMessage(entity.getType().name() + "'s source: " + area.getSource()); 
          } 
      }
      

      A test plugin is attached. Use command "/taec" to show nearby AreaEffectCloud nearby. The screenshot represents two lingering potions being thrown: One by myself, and one by dispenser.

       

      On the other hand: getShooter() from Arrows fired by dispenser works fine.

       

            Unassigned Unassigned
            cyclost Frank Wu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: