How do I make vanilla mobs drop custom drops? PLEASE HELP!

Started by Finemanederby on

Topic category: Help with modding (Java Edition)

Last seen on 20:08, 6. Sep 2022
Joined Apr 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do I make vanilla mobs drop custom drops? PLEASE HELP!

Somebody PLEASE give me an in-depth tutorial on how to do this! I'v been trying at it for years! 

Last seen on 00:36, 3. Mar 2020
Joined Sep 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Use a custom loot table the…
Sat, 06/16/2018 - 13:33

Use a custom loot table the only downside is that it has to be installed separately. This also lets you make it not drop a bone. There are generators for the tables

Last seen on 20:08, 6. Sep 2022
Joined Apr 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do I do that
Sat, 06/16/2018 - 14:46

How do I do that

Last seen on 20:08, 6. Sep 2022
Joined Apr 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@brickmaster5000 can you…
Sat, 06/16/2018 - 21:28

@brickmaster5000 can you teach me how to do this?

Last seen on 22:13, 3. Apr 2024
Joined Aug 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I will be honest, there is…
Sat, 06/16/2018 - 23:52

I will be honest, there is so much wrong with your code.
First of all, why is the name of your class in brackets? I mean, I get that most of MCreator users have never programmed in their life, but still, you could just quickly check like the first page of Java documentation or at least check how does the vanilla/MCreator generated code look.
Second, there is absolutely no reason why to create a new Random instance. Instead, use field "rand" in class World. You can get the World from field world" (in older versions "worldObj") from the entity you get from the event itself.
Speaking of versions, because in the log I can see MCreator 1.7.9, your target Minecraft version is 1.12.2 (unless you have changed it for some unknown reason in your Gradle settings). Why then are you importing cpw.mods package?!
This package has been replaced by a net.minecraftforge package.
The very last thing is that you are not even registering the event handler anywhere, but that does not matter as long as you do not fix the previously mentioned.

So once more:

  • Fix the class name
  • Don't create a new Random instance (optional but recommended)
  • Fix your imports
  • Register the event by EVENT_BUS or as a static event handler
Last seen on 20:08, 6. Sep 2022
Joined Apr 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Could you please fix the…
Sat, 06/16/2018 - 23:54

Could you please fix the code for me and send it here?

Last seen on 00:36, 3. Mar 2020
Joined Sep 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Google Minecraft tools loot…
Sun, 06/17/2018 - 16:17

Google Minecraft tools loot table generator. Mess around with that. Use a dummy item for the new item and just replace it at the end