Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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.

  • 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);
		}
	}
}
}

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.

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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.