How Do I Make Vanilla Mobs Drop My Custom Items? (1.8.9)

Started by TheRandomHero123 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Apr 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How Do I Make Vanilla Mobs Drop My Custom Items? (1.8.9)

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.

Joined Apr 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
RE:I have written here how to do
Mon, 06/12/2017 - 21:28

@#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(){}
}

 

Joined Aug 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
the "overlayTest" was just my
Mon, 06/12/2017 - 22:09

the "overlayTest" was just my name of the element. You must keep yours.