Posted November 4, 20168 yr I want to prevent that players can drink from a bucket of milk. I added milk bottles instead. It makes more sense for me drinking from bottles instead from a bucket (except if it's beer :-D) Alright the question is wich event is that? Where do i even find all those events? Has someone an up to date list of all the events? Currently this is what i have. I made a class TemEventHandlerOverride: public class TemEventHandlerOverride { @SubscribeEvent public void MilkBucketDrinkable(){ } } I did not fill in an event, because i don't know wich 1. I register it like this, in the preInit: MinecraftForge.EVENT_BUS.register(new TemEventHandlerOverride()); I'm not sure if it has to be registered in the preInit of Init. Try out my new Modpack for MC 1.15.2 https://www.curseforge.com/minecraft/modpacks/terran-civilization
November 4, 20168 yr Author Thank you. It seems i was looking in the wrong place. After importing PlayerInteractEvent i could see where all the stuff is. I was looking in the minecraft package, but i had to look in the net.minecraftforge.event package Try out my new Modpack for MC 1.15.2 https://www.curseforge.com/minecraft/modpacks/terran-civilization
November 4, 20168 yr Author Got it working. I hope i have done it right: public class TemEventHandlerOverride { @SubscribeEvent public void MilkBucketDrinkable(PlayerInteractEvent.RightClickItem event){ ItemStack stack = event.getItemStack(); if(stack!=null){ if (stack.getItem() == Items.MILK_BUCKET){ event.setCanceled(true); } } } } Try out my new Modpack for MC 1.15.2 https://www.curseforge.com/minecraft/modpacks/terran-civilization
November 4, 20168 yr Set the event priority to highest to try and make sure it happens before anything else. Also f you have done it right then it will work. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
November 4, 20168 yr I saw Lex Manos post a piece of code where he captures events and sends them to to nowhere land. Here https://github.com/LexManos/YUNoMakeGoodMap/blob/master/src/main/java/net/minecraftforge/lex/yunomakegoodmap/generators/StructureLoader.java#L48 He just gets all block events and they go away puff gone. Disclaimer: I been told to keep my opinions to myself, to shut up and that I am spreading lies and misinformation or even that my methods are unorthodox and or too irregular. Here are my suggestions take it or leave it.
November 4, 20168 yr I saw Lex Manos post a piece of code where he captures events and sends them to to nowhere land. Here https://github.com/LexManos/YUNoMakeGoodMap/blob/master/src/main/java/net/minecraftforge/lex/yunomakegoodmap/generators/StructureLoader.java#L48 He just gets all block events and they go away puff gone. That is him canceling all block updates not getting rid of events. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.