Jump to content

Custom Potion Effects


Moosemoosetwutwu

Recommended Posts

Don't rely on a tutorial to teach you information you need to know. Try and work backwards with the information you have. Maybe look inside some example in the game or from projects with open source code. Observe and interpret what you currently have, then come back with a specific question that you might have an issue with.

As a good starting point, potions and effects are hooked in by forge registries. They also have a method inside that allows the user to tick the entity affected with whatever they want.

Link to comment
Share on other sites

36 minutes ago, ChampionAsh5357 said:

Don't rely on a tutorial to teach you information you need to know.

I'd have to disagree a little. That's like saying go read a textbook without attending class. The point of tutorials is to teach it in a way that's more streamlined. But if tutorials don't exist for something, then yest it's good to look at the source or another mod.

3 hours ago, Moosemoosetwutwu said:
Anyone know how?

In the link below I go over a custom potion effect. If you have questions after that, ask them here though, not in that post. Invulnerability Effect help

Edited by urbanxx001
Link to comment
Share on other sites

17 minutes ago, urbanxx001 said:

That's like saying go read a textbook without attending class.

Not really. A tutorial is an interpretation of a "textbook" and is usually not reviewed or checked for errors/bad practices. Don't rely on a tutorial is just saying that to take them with the knowledge that most of the information has never been validated and is probably pirated off of someone else. You should use documentation and source to start when you begin and once you have a good grasp on the current practices maybe review a tutorial.

I'm not saying there's anything bad about tutorial. I'm just saying as a creator of non-reviewed tutorials that they can promote bad practices and can lead someone who just started in modding down the wrong path. Especially those who try to learn java and modding at the same since it will give them bad information on both the language and the current forum. That's more why forge recommends learning java beforehand so you can have an understanding in the language and be able to interpret information accurately instead of someone else's point of view.

Link to comment
Share on other sites

54 minutes ago, ChampionAsh5357 said:

most of the information has never been validated

That's why they usually launch the code in the test environment to show viewers that it works.

 

54 minutes ago, ChampionAsh5357 said:

You should use documentation

The Documentation is good for reference, but they "avoid examples in lieu of more thorough explanations" (from the github). This is great from the perspective of someone who already knows the basics and needs to brush up, but it feels disconnected when just starting out. Right now it's only for 1.15 as well (although most of that can apply to 1.16).

Edited by urbanxx001
Link to comment
Share on other sites

1 hour ago, urbanxx001 said:

That's why they usually launch the code in the test environment to show viewers that it works.

Just because something works in the test environment doesn't mean it's good practice. I can declare all my objects as static final variables without deferring anything and it will still work. However, it would be a terrible fate to attest to since issues wouldn't be present except in broader scenarios.

1 hour ago, urbanxx001 said:

This is great from the perspective of someone who already knows the basics and needs to brush up, but it feels disconnected when just starting out.

Everything feels disconnected when just starting out. This why we try things out until we understand how it works or ask questions for more specific topics. The objective of any programmer is to understand what they're doing, why they're doing it, and how they can complete it in a proper and/or efficient way. Following a tutorial just says here how's you do it without the what and why. We have to be able to problem solve in any situation presented to us. Whether that's through hard trial and error or asking others about the specific topic, it still allows the programmer to learn.

I do admit when I started out in modding I didn't understand anything. I used bad practices from code I figured out at the time and never updated to new standards. Nowadays, I try to be on top of what I'm doing else I would fall behind. I'm not going to wait to figure out how to do something from a post. I'm going to keep testing and learning why certain things are how they are and how to use them properly. That's the reason why I am arguing this point. I'm not arguing for or against using a tutorial. I'm arguing against relying on the tutorial in any scenario since you as the programmer should be able to infer and predict how to make it yourself. That's not to say it'll work, but it at least shows you tried to solve the problem before relying on someone else's solution.

  • Like 1
Link to comment
Share on other sites

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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