这篇阅读时长五分钟的文章可能是目前最有价值的模组开发入门指南。
笔者经常刷到所谓的“教你开发模组”系列视频。它们通常雄心勃勃地向你介绍模组开发的具体步骤,例如如何创建项目;其中有些甚至花费大量时间,向你传授编程基础。可往下一划,你就会在推荐视频栏目里看到很多过去类似的教程,它们往往都不了了之,即使你真的耐着性子看完,也可能仅仅学了个皮毛,做不出自己真正想要的东西。
这些教程往往忽视了一个重要且基础的问题,那就是分析并解决问题的思路。下文将试图补足这一点,并对你的模组开发之路有所启发。
# Configuration file | |
########################################################################################################## | |
# effects | |
#--------------------------------------------------------------------------------------------------------# | |
# Add potions effects that will be applied to players on respawn | |
########################################################################################################## | |
effects { | |
# Set to true to enable effects module |
# Generated by GPT 4 | |
# Modified by RisingInIris2017 | |
# Licensed under Public Domain | |
import os | |
import re | |
# 是否清除空行。如果设为 True,需先备份文件 | |
REMOVE_BLANK_LINES = True |
import com.mojang.datafixers.util.Function3; | |
import com.mojang.serialization.Codec; | |
import com.mojang.serialization.codecs.RecordCodecBuilder; | |
import net.minecraft.block.BlockState; | |
import java.util.List; | |
public class CodecExample { | |
public static final Codec<CodecExample> CODEC = RecordCodecBuilder.create( | |
instance -> instance.group( |
This is a fork of #8522, Silverminer's custom datapack registries PR, with some improvements to documentation and error presentation and streamlining of userdev APIs.
这是 #8522,Silverminer 的自定义数据包注册表 PR 的 Fork,改进了文档说明和报错,简化了供开发者使用的 API。
Datapack registries (sometimes called dynamic registries or worldgen registries) are a system added by Mojang several major versions ago, neither static registries nor reloadable data, but a third system separate from the other two. Datapack registries are created by registering a loading codec and (optionally) a network codec (if the network codec exists, we consider the registry to be a Synced Datapack Registry). Examples of vanilla datapack registries include biomes, dimensiontypes, and placed features.
---- Mohist Crash Report ---- | |
WARNING: coremods are present: | |
ForgelinPlugin ([前置]Forgelin-1.8.4.jar) | |
AppleCore ([前置]AppleCore-mc1.12.2-3.4.0.jar) | |
DupeFixProjectCoreMod ([优化][刷物品修复]DupeFixProject-1.12.2-3.1.2.jar) | |
FutureMC ([未来MC]future-mc-1.12.2-0.2.6.1.jar) | |
DCASMPlugin ([前置]HeatAndClimateLib_1.12.2-3.7.0.jar) | |
IvToolkit ([前置]IvToolkit-1.3.3-1.12.jar) | |
LoadingPlugin ([辅助]ResourceLoader-MC1.12.1-1.5.3.jar) |
---- Minecraft Crash Report ---- | |
// Who set us up the TNT? | |
Time: 2020-08-30 17:04:42 CST | |
Description: Exception ticking world | |
java.lang.IllegalArgumentException | |
at net.minecraft.util.WeightedRandom.getRandomItem(SourceFile:18) | |
at net.minecraft.util.WeightedRandom.getRandomItem(SourceFile:37) | |
at net.minecraft.world.WorldServer.getSpawnListEntryForTypeAt(WorldServer.java:246) |
{ | |
"_comment": { | |
"name": "Just a Reference to the old system naming. Changing does nothing.", | |
"is_enabled": "Is chicken enabled?", | |
"lay_item": "Item the chicken will Lay. Changing the qty will double that amount on each gain bonus. ", | |
"lay_item_example": { | |
"itemID": "minecraft:gold_ingot", | |
"metaID": 0 | |
}, | |
"drop_item": "Item the chicken will Lay. Changing the qty will double that amount on each gain bonus. ", |
[19:22:28] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLServerTweaker | |
[19:22:28] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLServerTweaker | |
[19:22:28] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLServerTweaker | |
[19:22:28] [main/DEBUG] [FML]: Injecting tracing printstreams for STDOUT/STDERR. | |
[19:22:28] [main/INFO] [FML]: Forge Mod Loader version 14.23.5.2854 for Minecraft 1.12.2 loading | |
[19:22:28] [main/INFO] [FML]: Java is OpenJDK 64-Bit Server VM, version 1.8.0_242, running on Windows Server 2019:amd64:10.0, installed at C:\Program Files\j2sdk-image\jre | |
[19:22:28] [main/DEBUG] [FML]: Java classpath at launch is: | |
[19:22:28] [main/DEBUG] [FML]: Mohist-1.12.2-310ebdb-server.jar | |
[19:22:28] [main/DEBUG] [FML]: Java library path at launch is: | |
[19:22:28] [main/DEBUG] [FML]: C:\Program Files\j2sdk-image\bin |