Started by
Finemanederby
on
Topic category: Help with Minecraft modding (Java Edition)
I have been trying to figure this out for weeks.. Someone please help!
Ex: Wither Skeleton drops "Wither Bone"
Topic category: Help with Minecraft modding (Java Edition)
I have been trying to figure this out for weeks.. Someone please help!
Ex: Wither Skeleton drops "Wither Bone"
You can subscribe to LivingDropsEvent event and add the drops here.
....What
Make a class, that has a static method, that takes as a parameter LivingDropsEvent event. Then you can get the entity from the event, check if the entity is that you desire and add to a list, that you can get from the event as well, the drops. Then add before the method @SubscribeEvent annotation, so the game can find it.
Fast example:
Do you by any chance know the entity name for the wither skeleton?
It is simply just EntityWitherSkeleton
How do I make a class and then add the @SubscribeEvent annotation? Sorry I am really new to coding.
You can simply create your own class using the button in the code editor or you can use already existing class from some other MCreator generated element (if you have chosen the later, I recommend you to use some dummy GUI Overlay element)
So I made a new class and copy and pasted the code you sent and the recompilation failed... I'm so confused..
It was a fast example - pseudocode - you have to use the exact method names from the event. It was meant for giving you some clue what you need to do. Also 2 more things.
First, every time when you have some error and you want help with it, post everything you can - code, console log/ crash log (if any). It is also quite recommended to use pastebin with correct Syntax Highlighting selected.
Second thing is that I have already answered this question here on a forum like 1- 2 years ago, so if you want, you can look there.
By the way, I have just make a fast look to the actual code for you and it seems that only difference between the pseudocode and the real one is that instead of "getLiving()" you have to use "getEntityLiving()". If you change this, it should work. If it does not, you can try to fix imports.
hey, you can create a procedure to that
if its a custom mob, do event: when entity is killed
spawn gem at x y z (item)
So... How do I get a wither skeleton to drop a custom item?
May I have a picture tutorial? That would be greatly appreciated.