Invoking Dispenser.dispense or Dropper.drop will not spawn entity

    • Type: Bug
    • Resolution: Cannot Reproduce
    • Priority: Minor
    • None
    • Affects Version/s: None
    • Environment:

      OS: Linux 3.19.0-22-generic
      Java: 1.9.0-ea

    • none

      I'm writing a plugin which invokes the method of BlockState.
      When I invoke Dispenser.dispense and Dropper.drop, I found no entity (Like item, arrow, fireball, etc) is spawned, while its content has been consumed.

          [SPIGOT-2228] Invoking Dispenser.dispense or Dropper.drop will not spawn entity

          mukiu added a comment -

          Confirmed asynchronous invocation in my code, sorry for disturbing.

          mukiu added a comment - Confirmed asynchronous invocation in my code, sorry for disturbing.

          md_5 added a comment -
              @EventHandler
              public void interact(PlayerInteractEvent event)
              {
                  if ( event.getPlayer().getItemInHand().getType() != Material.BONE || event.getHand() != EquipmentSlot.HAND )
                  {
                      return;
                  }
                  BlockState b = event.getClickedBlock().getState();
                  if ( b instanceof Dispenser )
                  {
                      ( (Dispenser) b ).dispense();
                  } else if ( b instanceof Dropper )
                  {
                      ( (Dropper) b ).drop();
                  }
          

          Cannot reproduce with above code.

          md_5 added a comment - @EventHandler public void interact(PlayerInteractEvent event) { if ( event.getPlayer().getItemInHand().getType() != Material.BONE || event.getHand() != EquipmentSlot.HAND ) { return ; } BlockState b = event.getClickedBlock().getState(); if ( b instanceof Dispenser ) { ( (Dispenser) b ).dispense(); } else if ( b instanceof Dropper ) { ( (Dropper) b ).drop(); } Cannot reproduce with above code.

          mukiu added a comment - - edited

          Please notice that Dispenser.dispense or Dropper.drop doesn't mean static methods of those classes, but methods of instances by calling block.getState() and checking cast.

          mukiu added a comment - - edited Please notice that Dispenser.dispense or Dropper.drop doesn't mean static methods of those classes, but methods of instances by calling block.getState() and checking cast.

            Assignee:
            Unassigned
            Reporter:
            mukiu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: