Minecraft / Blogs

Modding Tutorial (Adding New Armor Effects!)

  • 33
  • 10
  • comment77
  • playlist_add
  • share
  • more_horiz
avatar Surseance
Level 67 : High Grandmaster Modder
284
=== Armor Effects Tutorial ===

by MrXminister


Hey folks, this is my first modding tutorial so I'd appreciate if you gave me some constructive criticism/feedback! Alright, so, I realized that mo' tools and mo' armor mods are extremely common on these forums. In an attempt to vamp these up to the next level, I have a few lines of source code for ya! Here we go:

Here are some things to keep in mind for armor: 0 = boots, 1 = leggings, 2 = chest-plate, 3 = helmet
And also make sure you replace "ArmorNameHere" with your armor names!
This code belongs in your: mod_NameHere.java file!

Diamond if this was helpful!
Peace!

Click to reveal

Click to reveal

Click to reveal

Click to reveal

Click to reveal

Click to reveal
Tags

Comments : 77

star Login or register to post a comment.

Show Comments

1 - 50 of 77

Can you Private message me of how to make armor sets?
Nice
do we make a new class? or write it in our main.class?
  • Surseance
  • Level 67
  • High Grandmaster Modder
  • January 8, 2014, 1:14 pm
In the Item class, there is actually an armor update method you can call; it performs given operations on a per-tick basis. You should attempt using those instead of Tick Handlers. Alternatively, you could use Event Handlers --they are pretty fantastic.
so i do that in the item class
  • Surseance
  • Level 67
  • High Grandmaster Modder
  • January 9, 2014, 11:46 am
You can. Or you can register through the Event Bus to make your own Event Handler. I believe coolAlias has a tutorial somewhere on the Minecraft forums for making an event handler. I highly suggest you check it out.
okay i created it so do i do the jetpack code in the event handler
  • Surseance
  • Level 67
  • High Grandmaster Modder
  • January 26, 2014, 1:58 pm
You can. Or a TickHandler. Just so you know, you can only negate fall damage on the SERVER SIDE ONLY. Thus, when your event bus or Tick Handler is initiated, you will need to specify the side: @SideOnly(Side.SERVER)

Happy modding!
:)
  • Mimix2048
  • Level 34
  • Artisan Nether Knight
  • September 10, 2013, 5:27 am
This will help :)
You my friend are a god on earth.
  • Feniula
  • Level 8
  • Apprentice Toast
  • July 30, 2013, 12:08 pm
is this java?
This is minecraft.
Minecraft is coded in java.
What do YOU think?
  • Feniula
  • Level 8
  • Apprentice Toast
  • September 28, 2013, 8:25 am
jeez. sry im a noob. you dont have to be mean.
Why thank you <3
  • Feniula
  • Level 8
  • Apprentice Toast
  • September 28, 2013, 10:44 am
sry. probably shouldnt hav replied wen i did. was frustrated about something else. *embarassed face*
  • TheTrollapedia
  • Level 32
  • Artisan Electrician
  • September 28, 2013, 11:13 am
Aw, don't worry x3
Everyone's a noob at some point, it just takes practice!
MrArcane the the great, I soulfully thank you for the opportunity to be helped by you.
you are good
  • Surseance
  • Level 67
  • High Grandmaster Modder
  • May 15, 2013, 4:31 am
I wish I had time to update these tutorials!
  • ++Keks++
  • Level 1
  • New Miner
  • March 3, 2013, 10:35 am
The negate Fall Damage Code doesn't work anymore. Could you tell me how to get this working? I searched really long for this and now that doesn't work...(Sorry for my bad English, I'm from Germany)
  • Arist966
  • Level 1
  • New Miner
  • February 27, 2013, 1:14 pm
where do you put this code?
  • Tihyo
  • Level 1
  • New Miner
  • February 4, 2013, 12:29 pm
When you set entities on fire it does not do damage to them? How do you cause damage when you light them on fire!?
  • Twinklez
  • Level 75
  • Legendary Modder
  • February 25, 2013, 6:45 pm
Which kind of entity are you doing damage to.
It's lava damage.
  • Tihyo
  • Level 1
  • New Miner
  • March 1, 2013, 4:47 pm
I now get an error on

((entity instanceof EntityLiving)
  • Twinklez
  • Level 75
  • Legendary Modder
  • March 1, 2013, 5:33 pm
Your cast for entity, might not have been initialized.
  • Tihyo
  • Level 1
  • New Miner
  • March 1, 2013, 6:40 pm
How can I correct it. I never had this error in minecraft 1.4.5....
  • Twinklez
  • Level 75
  • Legendary Modder
  • March 2, 2013, 8:26 am
It might be that they changed Entity.class.

What I recommend doing is give me the whole code with a pastebin link.
  • Tihyo
  • Level 1
  • New Miner
  • March 3, 2013, 5:41 am
whole code for the main class or the entity class...
  • Twinklez
  • Level 75
  • Legendary Modder
  • March 3, 2013, 7:50 am
Both. Give me it in pastebin.
  • nickfromgreece
  • Level 53
  • Grandmaster Programmer
  • December 21, 2012, 7:37 am
[size=11px][color=rgb(34,34,34)]onTickInGame [/color][/size]

[size=11px]doesnt fire anymore this aint working :P[/size]
  • Surseance
  • Level 67
  • High Grandmaster Modder
  • December 21, 2012, 7:50 am
What does that even mean?
  • nickfromgreece
  • Level 53
  • Grandmaster Programmer
  • December 21, 2012, 7:53 am
you need to create your own tick handler for onTickInGame to work(mc Forge)
Nothing is working for me! Please help? Does this work for minecraft 1.4.5? I have importer the net.minecraft.client.Minecraft and got the Minecraft minecraft = ModLoader.getMinecraftInstance() in my public void load?
  • duke_Frans
  • Level 64
  • High Grandmaster Modder
  • December 9, 2012, 10:11 am
Cool, I liked the set entity on fire effect :D
How would I do it for invisibility? :D
  • Surseance
  • Level 67
  • High Grandmaster Modder
  • December 9, 2012, 3:27 am
Isn't there an invisibility potion? If so, just use its code!
I was looking for the invisibility potion code, but I couldn't find where all the potion effect codes were.
  • Surseance
  • Level 67
  • High Grandmaster Modder
  • December 9, 2012, 7:46 am
I will try and find it for you if I have time.
Thank You! :D
  • 8g2t
  • Level 18
  • Journeyman Cowboy
  • November 15, 2012, 7:18 pm
texture coppied and i think mod :p
  • Jeaciaz
  • Level 1
  • New Miner
  • October 24, 2012, 9:11 am
[size=10pt]When I just print the code, it compiles normally, but when i try to override it Eclipse throws an error:[/size]

[size=13px]The method onTickInGame(float, Minecraft) of type ObsiCraft must override or implement a supertype method[/size]
  • Surseance
  • Level 67
  • High Grandmaster Modder
  • October 24, 2012, 9:52 am
The onTickInGame(Minecraft minecraft, float f) must be placed in your mod_* file. Also, you might want to get a minecraft instance in the public void load() method: [size=11px]Minecraft minecraft = ModLoader.getMinecraftInstance();[/size]
  • Jeaciaz
  • Level 1
  • New Miner
  • October 24, 2012, 10:22 am
I use FML. Is your method compatible with it? I place onTickInGame afted public void load() {}. Adding "Minecraft minecraft = ModLoader.getMinecraftInstance();" into the body of public void load() doesn't fix the error.
  • Surseance
  • Level 67
  • High Grandmaster Modder
  • October 24, 2012, 10:40 am
Check this out as an example: pastebin.com/HepTvG4Y
  • Jeaciaz
  • Level 1
  • New Miner
  • October 24, 2012, 6:04 pm
The string
"[size=12px]ModLoader.[/size][size=12px][color=rgb(0,102,51)]setInGameHook[/color][/size][size=12px][color=rgb(0,153,0)]([/color][/size][size=12px]this[/size][size=12px], [/size][size=12px][color=rgb(0,0,102)]true[/color][/size][size=12px], [/size][size=12px][color=rgb(0,0,102)]true[/color][/size][size=12px][color=rgb(0,153,0)])[/color][/size][size=12px][color=rgb(51,153,51)];"
Is not compatible with Forge as it needs "BaseMod" file. Is there any other way to override onTickInGame method?[/color][/size]
  • Surseance
  • Level 67
  • High Grandmaster Modder
  • October 25, 2012, 1:50 am
Remove it then. I don't think it's absolutely necessary.
  • Jeaciaz
  • Level 1
  • New Miner
  • October 25, 2012, 3:09 am
I can't, because it really is necessary. As I can understand, exacty this string overrides method onTickInGame in your code. I tried to override mine with adding the "@Override", but it throws the error I've already showed/
  • Surseance
  • Level 67
  • High Grandmaster Modder
  • October 24, 2012, 10:39 am
onTickInGame(Minecraft minecraft) goes outside of the load method.
Also I think that onTickInGame is never called because I cant get them to work
  • Surseance
  • Level 67
  • High Grandmaster Modder
  • October 21, 2012, 1:48 pm
The onTickInGame(Minecraft minecraft) only works if Minecraft.client is imported. You do so by doing this:[size=11px][color=#a60069]import[/color] net.minecraft.client.Minecraft; [/size]Secondly, you need to check if the method is properly overriding the game code. If you're using Eclipse, look to the right hand side of the work area, and you might see a green triangle pointing upwards. If you see that, then you're in business. Also make sure the method returns true since it's a boolean.
Its not overriding but I imported minecraft.client
sorry kinda nooby
  • Surseance
  • Level 67
  • High Grandmaster Modder
  • October 22, 2012, 1:48 am
I'll update these tutorials soon.
That should help.
Ok just not sure how to override
  • Surseance
  • Level 67
  • High Grandmaster Modder
  • October 22, 2012, 11:49 am
The compiler overrides the code for you. The method is an overriding one, so if you made it properly, then it should be overriding that one for that particular class.
ok
Ill try that thanks for your help
Also error on List
Error on [color=rgb(166,0,105)]public[/color][color=rgb(34,34,34)] boolean onTickInGame([/color][color=rgb(166,0,105)]float[/color][color=rgb(34,34,34)] f, [/color][color=rgb(34,34,34)]Minecraft minecraft)[/color]
[color=rgb(34,34,34)]the bold thing[/color]
  • Surseance
  • Level 67
  • High Grandmaster Modder
  • October 21, 2012, 5:55 am
It's because you need to import net.minecraft.client and the java util list. Look at the top of my code for that.
what top that is the top
  • JavaBuckets
  • Level 78
  • Legendary Programmer
  • October 13, 2012, 1:46 am
Please update this 'Cause i really need this :=)
  • F3RULLO14
  • Level 95
  • Overlord Programmer
  • September 22, 2012, 3:44 am
Do these work with forge?
  • mathmods
  • Level 3
  • Apprentice Engineer
  • August 22, 2012, 9:07 am
Is This For 1.3.2?????
  • Surseance
  • Level 67
  • High Grandmaster Modder
  • August 22, 2012, 10:46 am
Sort of. You need to create a minecraft instance. For more info, check out my latest tutorial blog.
  • adlzman
  • Level 1
  • New Miner
  • August 5, 2012, 11:33 am
hey will you display more effects?
  • Surseance
  • Level 67
  • High Grandmaster Modder
  • August 5, 2012, 12:04 pm
Maybe in time. Just be patient, I have my own mods to update, you know.
  • adlzman
  • Level 1
  • New Miner
  • August 26, 2012, 2:14 pm
i have an error on 'Keyboard', but i imported it and it was fine. but i then get an error .isKeyDown. help?
  • adlzman
  • Level 1
  • New Miner
  • August 5, 2012, 11:56 am
i dont get any errors, but it doesnt work (jetpack or parachute)
  • eij1298
  • Level 36
  • Artisan Dragonborn
  • July 25, 2012, 12:22 pm
is this with or without modloader?
  • ccreations
  • Level 10
  • Journeyman Architect
  • July 17, 2012, 7:53 am
can you make me some high jump boots and in return i will give u a gfx bundle
  • ccreations
  • Level 10
  • Journeyman Architect
  • July 17, 2012, 6:22 am
can somebody please make me some jump boots mod for a gfx bundle or diamonds
  • Surseance
  • Level 67
  • High Grandmaster Modder
  • July 17, 2012, 7:21 am
Huh?
  • papertazer
  • Level 76
  • Legendary Creator
  • July 6, 2012, 4:58 pm
Triple
Boss

1 - 50 of 77

Show Comments

Planet Minecraft

Browse

Site

© 2010 - 2019
planetminecraft.com

Welcome