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

Started by Finemanederby on

Topic category: Help with Minecraft modding (Java Edition)

Active 2 years ago
Joined Apr 2015
Points:
975

User statistics:

  • Modifications: 3
  • Forum topics: 36
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 106
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! 

Active 4 years ago
Joined Sep 2017
Points:
930

User statistics:

  • Modifications: 7
  • Forum topics: 11
  • Wiki pages: 1
  • MCreator plugins: 0
  • Comments: 202
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

Active 2 years ago
Joined Apr 2015
Points:
975

User statistics:

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

How do I do that

Active 2 years ago
Joined Apr 2015
Points:
975

User statistics:

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

@brickmaster5000 can you teach me how to do this?

Active 9 months ago
Joined Aug 2013
Points:
1160

User statistics:

  • Modifications: 4
  • Forum topics: 6
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 737
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
Active 2 years ago
Joined Apr 2015
Points:
975

User statistics:

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

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

Active 4 years ago
Joined Sep 2017
Points:
930

User statistics:

  • Modifications: 7
  • Forum topics: 11
  • Wiki pages: 1
  • MCreator plugins: 0
  • Comments: 202
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