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

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

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/

  • Author

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

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.