本帖最后由 Edgecho 于 2019-7-21 14:48 编辑
我看了教程和forge官方文档都没有看到一个具体方法来改原版生物掉落
比如我想让烈焰人掉落岩浆膏,改写了烈焰人的getLootTable()方法,缺不能调用,求给个方法package name.modid.common.loot;
import net.minecraft.util.ResourceLocation;
import net.minecraft.entity.monster.EntityBlaze;
public class LootTableLoader {
public static void init() {
net.minecraft.world.storage.loot.LootTableList.register(new ResourceLocation("modid", "fire"));
}
protected ResourceLocation getLootTable()
{
return net.minecraft.world.storage.loot.LootTableList.register(new ResourceLocation("modid", "fire"));
}
}
我看了教程和forge官方文档都没有看到一个具体方法来改原版生物掉落
比如我想让烈焰人掉落岩浆膏,改写了烈焰人的getLootTable()方法,缺不能调用,求给个方法package name.modid.common.loot;
import net.minecraft.util.ResourceLocation;
import net.minecraft.entity.monster.EntityBlaze;
public class LootTableLoader {
public static void init() {
net.minecraft.world.storage.loot.LootTableList.register(new ResourceLocation("modid", "fire"));
}
protected ResourceLocation getLootTable()
{
return net.minecraft.world.storage.loot.LootTableList.register(new ResourceLocation("modid", "fire"));
}
}
LivingDropsEvent。
覆盖战利品表也是可以的——不过我不确定这样做是否可行。一般来说覆盖原版战利品表的方式是在存档目录下的 data/loot_tables 文件夹中新建同“路径”的战利品表 JSON,但这样做对 Modder 来说显得有些麻烦。如果楼主你确定要试一试,请展开折叠的内容。
覆盖战利品表也是可以的——不过我不确定这样做是否可行。一般来说覆盖原版战利品表的方式是在存档目录下的 data/loot_tables 文件夹中新建同“路径”的战利品表 JSON,但这样做对 Modder 来说显得有些麻烦。如果楼主你确定要试一试,请展开折叠的内容。
u.s.knowledge 发表于 2019-7-21 14:35
LivingDropsEvent。
覆盖战利品表也是可以的——不过我不确定这样做是否可行。一般来说覆盖原版战利品表的 ...
嗯好的我试试,我之前是在我自己的命名空间内弄的loot_table
u.s.knowledge 发表于 2019-7-21 14:35
LivingDropsEvent。
覆盖战利品表也是可以的——不过我不确定这样做是否可行。一般来说覆盖原版战利品表的 ...
失败了,一地烈焰棒...
Edgecho 发表于 2019-7-21 14:52
失败了,一地烈焰棒...
所以还是老老实实用 LivingDropsEvent 吧。
也许不久的将来我会研究一下如何覆盖战利品表…… 不过照这么说,也可以直接用 LootTableLoadEvent 来修改要加载的战利品表啊。
u.s.knowledge 发表于 2019-7-21 14:57
所以还是老老实实用 LivingDropsEvent 吧。
也许不久的将来我会研究一下如何覆盖战利品表…… 不过照这 ...
我记得是先注册一个然后在调用覆盖
Edgecho 发表于 2019-7-21 15:07
我记得是先注册一个然后在调用覆盖
你是不是和普通的 IForgeRegistry 弄混了???