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

LootTable ignores LootContext#lootingModifier

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • 1.15.2
    • Yes

      @EventHandler
      public void onEntityDeath(EntityDeathEvent event) {
          if(!(event.getEntity() instanceof Monster)) return;
          LootTable lootTable = ((Monster) event.getEntity()).getLootTable();
          if(lootTable != null) {
              event.getDrops().clear();
              LootContext lootContext = new LootContext.Builder(event.getEntity().getLocation())
                      .killer(event.getEntity().getKiller())
                      .lootedEntity(event.getEntity())
                      .lootingModifier(100)
                      .build();
              event.getDrops().addAll(lootTable.populateLoot(ThreadLocalRandom.current(), lootContext));
          }
      }
      

      Expected behaviour: a wither skeleton drops their head almost every time, monsters drop significantly more loot

      Actual behaviour: wither skeletons still drop their heads rarely, monsters drop around the same loot.

            Unassigned Unassigned
            konsolas Vincent
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: