Fabric-language Kotlin | NEWEST |
In gradle.properties :
Extension Functions fun PlayerEntity.giveItem(item: Item, count: Int = 1) inventory.offerOrDrop(ItemStack(item, count)) fabric-language kotlin
object MyMod : ModInitializer const val MOD_ID = "mymod" private val LOGGER = LoggerFactory.getLogger(MOD_ID) In gradle
repositories mavenCentral() maven url "https://maven.fabricmc.net/" maven url "https://maven.terraformersmc.com/" // optional count: Int = 1) inventory.offerOrDrop(ItemStack(item
Note: The fabric-language-kotlin module registers the kotlin language adapter automatically. Block with simple properties object ModBlocks val EXAMPLE_BLOCK: Block = Block(FabricBlockSettings.create() .strength(4.0f) .requiresTool() .mapColor(MapColor.STONE_GRAY)) fun register() Registry.register(Registries.BLOCK, Identifier(MOD_ID, "example_block"), EXAMPLE_BLOCK)




