Jump to content

Recommended Posts

Posted

First I want to say that I did search for other topics and there were some similar ones but none have given me a solution.

 

I am adding information to the nbt of any item that extends ItemArmor and is used with my TE.

This integer tag represents a tier that I am adding to the item which will increases the wearers reach based on the tier

 

Because this is not specific to my armor I cannot use the onArmorTick method.

The closest thing I have found is to use the player event for onOpenContainer but that is not going to be a very clean or reliable way of applying this effect.

 

I'd rather not mess with enchantments because as far as I can tell they have the most unfriendly setup for adding new effects I have ever seen, besides the fact that they are not going to merge well with how I want to set up my tiering(practically infinite, actually log base 2 of max int).

 

Hopefully someone here knows a good place that I can use to hook into otherwise I guess I'll have to bite the bullet and figure out enchantments.

Current Project: Armerger 

Planned mods: Light Drafter  | Ore Swords

Looking for help getting a mod off the ground? Coding  | Textures

Posted

Is this going to happen in your own custom GUI? Or when player is wearing the armor in an armor slot?

 

In the case of your own custom GUI, then I think you can do anything you want -- you could check the slots every tick, or you could maybe change the transferInSlot() method to do what you want.

 

In the case where the armor is worn, you would just use the player tick event and check the player inventory for the armor slot positions. If you detect an item stack with an armor you're interested in, you can do what you want with it. If you want to add an effect to vanilla armor without using enchantements, I think this is the way to go.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Posted

I was not planning on making a separate gui and this effect is meant to be possible to use on anything that extends ItemArmor.

 

Well, that will get the job done, it just seems like unnecessary processing.

 

I know the if checks take practically 0 runtime but it feels like such a waste to check them every tick when I only need it when they switch what they are wearing.

 

 

Current Project: Armerger 

Planned mods: Light Drafter  | Ore Swords

Looking for help getting a mod off the ground? Coding  | Textures

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.