Started by
Adamskii6
on
Topic category: Help with Minecraft modding (Java Edition)
So, I've started on a mod that makes sand in the beach biome drop some seashells. How do I do this? I've created the seashells but I don't know how to make a vanilla sandblock drop them, especially in the beach biome. This is all really difficult and I have very little experience with coding so please try to explain how I should do it. Thanks!
i dont think its possible without coding
You can't, it's actually against Minecraft's TOS, but there might be a way using forge methods.
You need first make a event handler. For this you can use GUI Overlay elements (because it is bascially event handler already). There you need subscribe for BlockEvent.HarvestDropsEvent add your item to dropList. So something like:
@SubscribeEvent
public void onBlockBreak(BlockEvent.HarvestDropsEvent event)
{
if(event.state.getBlock() == Blocks.sand && event.world.getBiomeGenForCoords(event.pos).biomeName == "Beach"){
event.drops.add(YOUR_ITEM);
}
}
In case that you will get errors that some field is private , you will need use some getters like for example "getWorld()" instead of "world"
Naparu thanks to you i'm one step closer to finally creating my first event handler. I've spent almost 2 weeks doing research and some trial and error. I however have still not managed to get it to work. I see there is a public static class GUIRenderEventClass { built inside the Gui overlay's code.
Are we supposed to replace that with our own? including the @subscribeEvent that comes right after it? I'm a bit confused, but I'm very close to making it. Please reply you are one of the most knowledgeable people I've seen giving explanations here on Mcreator.
Thanks