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

On the RegistryEvent.Register<Item> event I made a substitution alias: GameRegistry.addSubstitutionAlias("minecraft:map", GameRegistry.Type.ITEM, myEmptyMap); where myEmptyMap is an instance of com.example.MyEmptyMap that extends net.minecraft.item.ItemEmptyMap.

In The constructor of net.minecraft.item.ItemEmptyMap there is the call to setCreativeTab(CreativeTabs.MISC); so I left my constructor empty.

Why in the misc tab there are 2 minecraft:map items? How can i remove one?

 

Thx

 

I reported this here, cpw isn't intending to fix it.

 

You can probably set the vanilla Item's creative tab to null before you substitute it to prevent it from showing up in the creative menu.

Edited by Choonster

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

  • Author
4 hours ago, Choonster said:

I reported this here, cpw isn't intending to fix it.

 

You can probably set the vanilla Item's creative tab to null before you substitute it to prevent it from showing up in the creative menu.

As cpw said this is a sided effect so the method addSubstitutionAlias must be called only in server side. The solution is to  remove it from client proxy.

Thx

  • Author

But if you have to overwrite a method of the item in both sides? Let's say that you want to overwrite onItemRightClick?

11 minutes ago, Zacomat said:

As cpw said this is a sided effect so the method addSubstitutionAlias must be called only in server side. The solution is to  remove it from client proxy.

Thx

 

He said it's a side effect, not a sided effect.

 

This has nothing to do with the client/server sides.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

  • Author

I tried this but it does not work:

 

@SubscribeEvent

public void onRegisterEvent(RegistryEvent.Register<Item> event) {

   Items.MAP.setCreativeTab(null);

    try {

             GameRegistry.addSubstitutionAlias("minecraft:map", GameRegistry.Type.ITEM, MyMod.myEmptyMap);

         } catch (ExistingSubstitutionException e) {

        e.printStackTrace();

    }

}

 

Still 2 items in the misc tab.

Looking into this further, the original Item is never returned by the registry iterator used in CreativeTabs#displayAllRelevantItems; the substitution is returned twice. This explains why setting the creative tab of the original Item doesn't work.

 

I'm not sure if there's any way to fix this.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

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.