Started by
TheRandomHero123
on
Topic category: Help with Minecraft modding (Java Edition)
Im making a mod and I want to make squids more useful so I created squid meat. The only problem is that I don't know how to make squids drop the meat when they die. Can anyone help me with this? Thanks in advance.
I have written here how to do it about 1 year ago: https://mcreator.pylo.co/forum/17348/how-change-mob-drops.
Because you use 1.8.9, the code should be completely identical.
@#1 I tried doing that with the squid, but it didn't work. I thought it was just something that I changed when trying to make it a squid and stuff, so I tried to directly copy and paste everything in the comment you made, but it crashed again. Here's the crash log, and the code. Could you please help me out with this, and point out anything I did wrong? Thanks.
C:\Users\Owner\Desktop\MCreator 1.6.6 [1.8.9] Windows 64bit\forge\build\sources\main\java\mod\mcreator\mcreator_squidDroppings.java:109: error: class mcreator_overlayTest is public, should be declared in a file named mcreator_overlayTest.java
public class mcreator_overlayTest{
^
C:\Users\Owner\Desktop\MCreator 1.6.6 [1.8.9] Windows 64bit\forge\build\sources\main\java\mod\mcreator\TestEnvironmentMod.java:109: error: cannot find symbol
mcreator_squidDroppings mcreator_3 = new mcreator_squidDroppings();
^
symbol: class mcreator_squidDroppings
location: class TestEnvironmentMod
C:\Users\Owner\Desktop\MCreator 1.6.6 [1.8.9] Windows 64bit\forge\build\sources\main\java\mod\mcreator\TestEnvironmentMod.java:109: error: cannot find symbol
mcreator_squidDroppings mcreator_3 = new mcreator_squidDroppings();
^
symbol: class mcreator_squidDroppings
location: class TestEnvironmentMod
3 errors
:compileJava FAILED
BUILD FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Total time: 15.419 secs
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
public class mcreator_overlayTest{
public static class GUIRenderEventClass
{ public void playerKilledZombie(LivingDropsEvent event)
{
if(event.entityLiving instanceof EntityZombie)
{
event.entityLiving.dropItem(Items.rotten_flesh, 1);
event.entityLiving.dropItem(Items.bone, 1);
}
}}
public mcreator_overlayTest(){}
public Object instance;
public void load(FMLInitializationEvent event){
MinecraftForge.EVENT_BUS.register(new GUIRenderEventClass());
}
public void generateNether(World world, Random random, int chunkX, int chunkZ){}
public void generateSurface(World world, Random random, int chunkX, int chunkZ){}
public int addFuel(ItemStack fuel){return 0;}
public void serverLoad(FMLServerStartingEvent event){}
public void preInit(FMLPreInitializationEvent event){}
public void registerRenderers(){}
}
the "overlayTest" was just my name of the element. You must keep yours.