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

Hello,  :)

 

I am trying to make a mod that includes survival spawn eggs and I want them to be noticeably different from the creative ones. Would it be possible to:

  • Give the shine effect (the one on enchanted items and on other items like the Notch Apple) to the spawn eggs
  • Rename the spawn eggs to "Creative Spawn [mob]"

I want to try to do this in the most efficient (and least confusing) way possible. I believe I have seen something like this done before in other mods. Also, there have been various other posts I have seen, but they're all either outdated or don't exactly apply to what I want to do. And if you are going to suggest the @Override (I don't know if this pertains to this), please try to give me a more detailed description of how I'm supposed to use it, because I'm completely clueless about it. I am in forge 1.8-11.14.3.1450, if that matters.

 

Thanks!

ComputerCraze  ;)

The shine effect is controlled by the return value of

Item#hasEffect

. The default implementation only returns

true

when the

ItemStack

is enchanted (i.e. it has a compound tag with the

"ench"

key). This means there's no easy way to force an existing item to always display the effect without replacing it your own or resorting to ASM (neither of which is desirable).

 

Changing the display name is much easier, just add a translation with the same key as the vanilla one (

item.monsterPlacer.name

) in your own lang files.

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

The shine effect is controlled by the return value of

Item#hasEffect

. The default implementation only returns

true

when the

ItemStack

is enchanted (i.e. it has a compound tag with the

"ench"

key). This means there's no easy way to force an existing item to always display the effect without replacing it your own or resorting to ASM (neither of which is desirable).

 

Changing the display name is much easier, just add a translation with the same key as the vanilla one (

item.monsterPlacer.name

) in your own lang files.

 

Just out of curiosity, what is ASM? Is it easier than replacing all of the spawn eggs with items in my mod?

Just out of curiosity, what is ASM? Is it easier than replacing all of the spawn eggs with items in my mod?

 

ASM is a library that allows you to manipulate the bytecode of classes at runtime. There aren't many tutorials on using it in coremods, since you should avoid using it unless you have a solid understanding of the bytecode format and you absolutely need to use it.

 

Replacing the vanilla item with your own won't be easy and may not be possible. You can remove it from the creative menu, but players will still be able to obtain it through NEI or the

/give

command.

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

Just out of curiosity, what is ASM? Is it easier than replacing all of the spawn eggs with items in my mod?

 

ASM is a library that allows you to manipulate the bytecode of classes at runtime. There aren't many tutorials on using it in coremods, since you should avoid using it unless you have a solid understanding of the bytecode format and you absolutely need to use it.

 

Replacing the vanilla item with your own won't be easy and may not be possible. You can remove it from the creative menu, but players will still be able to obtain it through NEI or the

/give

command.

 

Ah. Thanks, you've really helped me. But just in case I'm missing something, is there possibly another alternative to adding the shine effect? Also, I only want to make the vanilla spawn eggs different from the new kind of spawn eggs I am adding.

Ah. Thanks, you've really helped me. But just in case I'm missing something, is there possibly another alternative to adding the shine effect? Also, I only want to make the vanilla spawn eggs different from the new kind of spawn eggs I am adding.

 

Have you considered just using a different texture for your own item or changing its design to be something other than an egg?

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

Ah. Thanks, you've really helped me. But just in case I'm missing something, is there possibly another alternative to adding the shine effect? Also, I only want to make the vanilla spawn eggs different from the new kind of spawn eggs I am adding.

 

Have you considered just using a different texture for your own item or changing its design to be something other than an egg?

Wow I can't believe I hadn't though of that. I sometimes really do think too hard  ;D Thanks so much!

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.