You can now safely collect slime pustules with shears and silk touch tools

This commit is contained in:
Sollace 2024-02-26 23:04:38 +00:00
parent 5d7227f547
commit 8a2463d0a8
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB
2 changed files with 56 additions and 1 deletions

View file

@ -115,7 +115,7 @@ public class SlimePustuleBlock extends Block {
@Override
public void onBreak(World world, BlockPos pos, BlockState state, PlayerEntity player) {
if (state.get(SHAPE) == Shape.POD) {
world.getOtherEntities(null, new Box(pos).expand(1)).forEach(entity -> {
world.getOtherEntities(player.canHarvest(state) ? player : null, new Box(pos).expand(1)).forEach(entity -> {
entity.damage(entity.getDamageSources().inFire(), 2);
entity.setFireTicks(3);
});

View file

@ -0,0 +1,55 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1.0,
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:item",
"name": "unicopia:slime_pustule"
}
],
"conditions": [
{
"condition": "minecraft:all_of",
"terms": [
{
"block": "unicopia:slime_pustule",
"condition": "minecraft:block_state_property",
"properties": {
"shape": "pod"
}
},
{
"condition": "minecraft:any_of",
"terms": [
{
"condition": "minecraft:match_tool",
"predicate": {
"items": [
"minecraft:shears"
]
}
},
{
"condition": "minecraft:match_tool",
"predicate": {
"enchantments": [
{
"enchantment": "minecraft:silk_touch",
"levels": {
"min": 1
}
}
]
}
}
]
}
]
}
]
}
]
}