Files
src
build.gradle
gradle.properties
settings.gradle
Spiderlily
Code
12 303
src/main/java/com/kodari/stonespiderlily/StoneSpiderLilyMod.java
package com.kodari.stonespiderlily;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
import net.minecraft.block.AbstractBlock;
import net.minecraft.block.Block;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.util.Identifier;
public final class StoneSpiderLilyMod implements ModInitializer {
public static final String MOD_ID = "stone_spider_lily";
public static final RegistryKey<Block> STONE_SPIDER_LILY_BLOCK_KEY =
RegistryKey.of(RegistryKeys.BLOCK, Identifier.of(MOD_ID, "stone_spider_lily"));
public static final Block STONE_SPIDER_LILY = Registry.register(
Registries.BLOCK,
STONE_SPIDER_LILY_BLOCK_KEY,
new Block(AbstractBlock.Settings.create()
.registryKey(STONE_SPIDER_LILY_BLOCK_KEY)
.strength(0.5F)
.nonOpaque()
.noCollision())
);
public static final RegistryKey<Item> STONE_SPIDER_LILY_ITEM_KEY =
RegistryKey.of(RegistryKeys.ITEM, Identifier.of(MOD_ID, "stone_spider_lily"));
public static final Item STONE_SPIDER_LILY_ITEM = Registry.register(
Registries.ITEM,
STONE_SPIDER_LILY_ITEM_KEY,
new BlockItem(STONE_SPIDER_LILY, new Item.Settings().registryKey(STONE_SPIDER_LILY_ITEM_KEY))
);
@Override
public void onInitialize() {
ItemGroupEvents.modifyEntriesEvent(
RegistryKey.of(RegistryKeys.ITEM_GROUP, Identifier.of("minecraft", "natural_blocks"))
).register(entries -> entries.add(STONE_SPIDER_LILY_ITEM));
}
}