[5] Loot tables, dropping blocks, experience block, example ore block
This commit is contained in:
parent
260d3ec1a9
commit
0ae49bbbdb
@ -17,11 +17,13 @@ import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
|
|||||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.Blocks;
|
import net.minecraft.block.Blocks;
|
||||||
|
import net.minecraft.block.ExperienceDroppingBlock;
|
||||||
import net.minecraft.item.BlockItem;
|
import net.minecraft.item.BlockItem;
|
||||||
import net.minecraft.registry.Registries;
|
import net.minecraft.registry.Registries;
|
||||||
import net.minecraft.registry.Registry;
|
import net.minecraft.registry.Registry;
|
||||||
import net.minecraft.sound.BlockSoundGroup;
|
import net.minecraft.sound.BlockSoundGroup;
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
|
import net.minecraft.util.math.intprovider.UniformIntProvider;
|
||||||
|
|
||||||
public class BlockManager {
|
public class BlockManager {
|
||||||
|
|
||||||
@ -70,7 +72,8 @@ public class BlockManager {
|
|||||||
|
|
||||||
// Register example block to the mod
|
// Register example block to the mod
|
||||||
Block exampleBlock = new Block(FabricBlockSettings.copyOf(Blocks.IRON_BLOCK).sounds(BlockSoundGroup.AMETHYST_BLOCK).requiresTool().breakInstantly());
|
Block exampleBlock = new Block(FabricBlockSettings.copyOf(Blocks.IRON_BLOCK).sounds(BlockSoundGroup.AMETHYST_BLOCK).requiresTool().breakInstantly());
|
||||||
|
Block exampleBlockOre = new ExperienceDroppingBlock(FabricBlockSettings.copyOf(Blocks.IRON_BLOCK).sounds(BlockSoundGroup.ANCIENT_DEBRIS).requiresTool(), UniformIntProvider.create(4, 20));
|
||||||
|
RegisterBlock("example_block_ore", exampleBlockOre);
|
||||||
RegisterBlock("example_block", exampleBlock);
|
RegisterBlock("example_block", exampleBlock);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"variants": {
|
||||||
|
"": {
|
||||||
|
"model": "keeblarcraft:block/example_block_ore"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -6,5 +6,6 @@
|
|||||||
|
|
||||||
"itemgroup.keeblarcraft": "Keeblarcraft Modded Items",
|
"itemgroup.keeblarcraft": "Keeblarcraft Modded Items",
|
||||||
|
|
||||||
"block.keeblarcraft.example_block": "Keeblarcraft example block"
|
"block.keeblarcraft.example_block": "Keeblarcraft example block",
|
||||||
|
"block.keeblarcraft.example_block_ore": "Keeblarcraft example block ore"
|
||||||
}
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"parent": "block/cube_all",
|
||||||
|
"textures": {
|
||||||
|
"all": "keeblarcraft:block/example_block_ore"
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"parent": "keeblarcraft:block/example_block_ore"
|
||||||
|
}
|
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"replace": false,
|
"replace": false,
|
||||||
"values": [
|
"values": [
|
||||||
|
"keeblarcraft:example_block_ore"
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"type": "minecraft:block",
|
||||||
|
"pools": [
|
||||||
|
{
|
||||||
|
"bonus_rolls": 0.0,
|
||||||
|
"conditions": [
|
||||||
|
{
|
||||||
|
"condition": "minecraft:survives_explosion"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"entries": [
|
||||||
|
{
|
||||||
|
"type": "minecraft:item",
|
||||||
|
"name": "keeblarcraft:example_block_ore"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"rolls": 1.0
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"type": "minecraft:crafting_shaped",
|
||||||
|
"category": "misc",
|
||||||
|
"pattern": [
|
||||||
|
" # ",
|
||||||
|
"###",
|
||||||
|
" # "
|
||||||
|
],
|
||||||
|
"key": {
|
||||||
|
"#": {
|
||||||
|
"item": "keeblarcraft:example_block_ore"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"result": {
|
||||||
|
"item": "keeblarcraft:example_block",
|
||||||
|
"count": 8
|
||||||
|
}
|
||||||
|
}
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"replace": false,
|
"replace": false,
|
||||||
"values": [
|
"values": [
|
||||||
"keeblarcraft:example_block"
|
"keeblarcraft:example_block",
|
||||||
|
"keeblarcraft:example_block_ore"
|
||||||
]
|
]
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user