[SPIGOT-5603] LootTable ignores LootContext#lootingModifier Created: 01/Mar/20 Updated: 08/Apr/20 Resolved: 08/Apr/20 |
|
Status: | Resolved |
Project: | Spigot |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Bug | Priority: | Minor |
Reporter: | Vincent | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 0 |
Labels: | loottable |
Version: | 1.15.2 |
Guidelines Read: | Yes |
Description |
@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. |
Comments |
Comment by Vincent [ 01/Mar/20 ] |
Hey, thanks for asking. I've already opened a pull request: https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/pull-requests/638 Please feel free to review it. |
Comment by TheCreeperCow [ 01/Mar/20 ] |
Vincent since i know you like to work on your issues are you working on this? |