diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/event/BucketFillEvent.java b/src/main/java/de/ellpeck/actuallyadditions/mod/event/BucketFillEvent.java index 1aa29f8a1..d3bd5b97a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/event/BucketFillEvent.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/event/BucketFillEvent.java @@ -30,11 +30,13 @@ public class BucketFillEvent{ } private void fillBucket(FillBucketEvent event, Item item, Block fluid){ - Block block = PosUtil.getBlock(event.getTarget().getBlockPos(), event.getWorld()); - if(block == fluid){ - event.getWorld().setBlockToAir(event.getTarget().getBlockPos()); - event.setFilledBucket(new ItemStack(item)); - event.setResult(Event.Result.ALLOW); + if(event.getTarget() != null && event.getTarget().getBlockPos() != null){ + Block block = PosUtil.getBlock(event.getTarget().getBlockPos(), event.getWorld()); + if(block == fluid){ + event.getWorld().setBlockToAir(event.getTarget().getBlockPos()); + event.setFilledBucket(new ItemStack(item)); + event.setResult(Event.Result.ALLOW); + } } } }