如题,版本1.16
修改方块掉落物,例如挖掘石头后原本掉落圆石,修改为只掉落泥土,不可被时运影响
修改方块掉落物,例如挖掘石头后原本掉落圆石,修改为只掉落泥土,不可被时运影响
- import crafttweaker.api.loot.conditions.LootConditionBuilder;
- import crafttweaker.api.loot.conditions.vanilla.BlockStateProperty;
- import crafttweaker.api.loot.modifiers.CommonLootModifiers;
- loot.modifiers.register(
- // Name of the loot modifier.
- "cobble_to_dirt",
- // On what condition(s) should this modifier come in effective?
- // Only when the block is vanilla stone.
- LootConditionBuilder.createForSingle<BlockStateProperty>(condition => {
- condition.withBlock(<block:minecraft:stone>);
- }),
- // How should we handle the loots?
- // By replacing any cobblestone with dirt.
- // Size is not preserved. Meaning, if the stone block drops >= 2 cobblestones
- // by any chance, only 1 dirt will appear in the final result.
- CommonLootModifiers.replaceWith(<item:minecraft:cobblestone>, <item:minecraft:dirt>)
- );