when I changed it from ZombieEntity to CowEntity and from a Minecraft Item to my Item the drop would not work, it is different between passive and monsters?
it is called there and then registered here at : event.getRegistry().register(new Item(new Item.Properties().group(SkyrimCraftItems.instance)).setRegistryName("cow_hide"));
I can get to the item in-game by creative tab or /give just not by dropping by a cow
This is very messy. I don't see where you ever assigned a value to cow_hide
Are any of your items even working?
it seems to only be set to null and never called
If you look at the top of the class, he added the ObjectHolder annotation which assigns the value to it when it's registered.
That being said, while I guess you can add drops when a cow dies, I suggest looking into loot tables and adding your item to the cow loot drop. More info here: https://minecraft.gamepedia.com/Loot_table#Data_packs
Hello, I am wondering how to change vanilla code and change vanilla mob drops for my mod. Any help is appreciated!! I am using forge 1.15.2.
edit: BUMP!
This should be simple.
Just use an event handler, example of having zombies drop 32 apples instead of rotten flesh:
I am starting do small simple mod request. If the mod can be made in an hour I will do it for you.
Portfolio
TempTorch BabyAnimal MiningTNT SnowBallDamage EnderAdvancement HydratedFarms
when I changed it from ZombieEntity to CowEntity and from a Minecraft Item to my Item the drop would not work, it is different between passive and monsters?
No, it isn't different. Please post your event and item code.
I am starting do small simple mod request. If the mod can be made in an hour I will do it for you.
Portfolio
TempTorch BabyAnimal MiningTNT SnowBallDamage EnderAdvancement HydratedFarms
I have this in my main mod class:
Try to change
to
If this does not work i need you to paste the ItemInit class.
I am starting do small simple mod request. If the mod can be made in an hour I will do it for you.
Portfolio
TempTorch BabyAnimal MiningTNT SnowBallDamage EnderAdvancement HydratedFarms
It didn't work, here is my ItemInit:
This is very messy. I don't see where you ever assigned a value to cow_hide
Are any of your items even working?
it seems to only be set to null and never called
Here is github from Technovision that has tutorial for Items and deferred registry:
https://github.com/TechnoVisionDev/Minecraft-1.15.2-Modding-Tutorial
I am starting do small simple mod request. If the mod can be made in an hour I will do it for you.
Portfolio
TempTorch BabyAnimal MiningTNT SnowBallDamage EnderAdvancement HydratedFarms
it is called there and then registered here at : event.getRegistry().register(new Item(new Item.Properties().group(SkyrimCraftItems.instance)).setRegistryName("cow_hide"));
I can get to the item in-game by creative tab or /give just not by dropping by a cow
That's is not registering the static variable. That registry line is creating a new cow hide.
You can test this by deleting the public static item cow_hide = null and it will still show on creative.
That is why I think you should rethink how you are doing the registry and follow the GitHub format.
I am starting do small simple mod request. If the mod can be made in an hour I will do it for you.
Portfolio
TempTorch BabyAnimal MiningTNT SnowBallDamage EnderAdvancement HydratedFarms
If you look at the top of the class, he added the ObjectHolder annotation which assigns the value to it when it's registered.
That being said, while I guess you can add drops when a cow dies, I suggest looking into loot tables and adding your item to the cow loot drop. More info here: https://minecraft.gamepedia.com/Loot_table#Data_packs
My Mods:
- Happy Coding -
I figured it out, I needed to put final when I declared my item, I had the same issue with my Creative Tab!!
One last question, how would I make it have a min and max for my item drop?
Use RNG to dictate the stack size
I am starting do small simple mod request. If the mod can be made in an hour I will do it for you.
Portfolio
TempTorch BabyAnimal MiningTNT SnowBallDamage EnderAdvancement HydratedFarms
Why adding cow hide that's litteraly leather