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 create multiple types of visual enchantment effects (the vanilla purple glow not the enchantments themselves). How would I go about doing this?

 

 

So far I've looked at the RenderItem class and it would seem that the game uses the renderItem method to check if an item is enchanted and the renderEffect method to actually create the effect. I thought could override the renderEffect method but it's private. I tried making my own version of the method but it required a lot more private methods and my file started looking like a mangled mess. I thought maybe I could copy over the whole of RenderItem into my own class but I have no idea how to call that instead of the default.

 

Any help would be appreciated!  :)

 

 

Made a PR on this a few weeks back and it got shot down because expansion here is bad for performance.

https://github.com/MinecraftForge/MinecraftForge/pull/2458

 

In short you can't do it easily. Even swapping out the render item instances with your own results in a lot of issues caused by the surplus of private methods and GLState headaches.

 

The other option is ASM- which is frowned upon. I've recently written a class transformer for implementing a wrapper for custom effects that does the job but it's skewed towards shader use at the moment. Thinking about pushing it out as an API to make the handling of effect passes an optional thing if there's the demand for it.

 

I think its my java of the variables.

  • Author

Very informative, thank you! Would you have any idea if this mod:

 

 

http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1280263-animated-enchantments-1-0-0

 

 

Implements something similar to what you've done? Or has forge changed? Or is it a more basic modification?

 

EDIT: Just saw that the mod is most likely using ASM. Why is it frowned upon?

EDIT: Just saw that the mod is most likely using ASM. Why is it frowned upon?

 

His pull request is a patch.  Its like ASM (uses the same principles) but means that if integrated into the Forge codebase it would be shipped with every version of Forge from then on.

 

ASM is frowned upon for two reasons:

1) There is almost certainly another way to make the change through the event system

2) It is very very easy to make a coremod that conflicts with someone else's coremod

3) ASM will drive you insane trying to learn it

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author

Ok, thanks for answering my questions! Since I'm fairly new to forge modding and Java, I'll stick to more basic/less compatability breaking things. But, if I ever decide to look into this some more I'll have a few places to start.

Just stay away from coremods, life will be simpler. :P

 

ASM is a dark abyss that looks back.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Just stay away from coremods, life will be simpler. :P

 

I will definitely back this. Mostly because it's a nightmare starting out with

1) You're dealing with byte code which works on a token stack, totally different approaches

2) Errors are sparse and often difficult to read in comparison to 'normal java errors'

3) Very little documentation to be found on the matter. Took me ages to track down the references I needed for it to click

4) Getting help with it will be next to impossible since it takes a lot off back and forth (effort) to troubleshoot something you're being discouraged from doing anyways

5) You can easily mess something up that will take a ton of debugging to actually present itself as an issue

6) Murphy is lurking

I think its my java of the variables.

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.