The Meaning of Life, the Universe, and Everything.
Join Date:
6/2/2014
Posts:
100
Minecraft:
teh_herper
Member Details
Also, Is there a way to stop getArmorDisplay from overriding the reduction amounts set in the ArmorMaterial? Or is there a way to alter each piece of armor individually?
Rollback Post to RevisionRollBack
Fact: Using flint and steel on a creeper causes them to stop in place and blow up.
Also, Is there a way to stop getArmorDisplay from overriding the reduction amounts set in the ArmorMaterial? Or is there a way to alter each piece of armor individually?
getArmorDisplay() is called for each piece of armor.
It is causing lag because each piece is constantly performing this check. You're going to want to have once piece perform all checking.
Could u show me an example how to make it into one piece i cant really solve it please
Pick any random piece you want to have perform the check. Create an if() statement to see if the player is wearing said piece. Inside of that if statement then check for the rest of the armor.
Wait one more complicated thing what do you mean by check is that another if statement?
Yes
So heres what will i do .
if(boots !=null){//checking if the player is wearing the said piece
if(this == myhelm){
if(this == mychest){
if(this == mylegs){
if(this == myboots){
perform action
Wait one more complicated thing what do you mean by check is that another if statement?
Yes
So heres what will i do .
if(boots !=null){//checking if the player is wearing the said piece
if(this == myhelm){
if(this == mychest){
if(this == mylegs){
if(this == myboots){
perform action
Wait one more complicated thing what do you mean by check is that another if statement?
Yes
So heres what will i do .
if(boots !=null){//checking if the player is wearing the said piece
if(this == myhelm){
if(this == mychest){
if(this == mylegs){
if(this == myboots){
perform action
No no no no no. This is the format:
if() {
if() {
if(){
//etc...
}
}
}
But my code is right?
EDIT: DINT WORK -__- damn this really simple code stress me much
Wait one more complicated thing what do you mean by check is that another if statement?
Yes
So heres what will i do .
if(boots !=null){//checking if the player is wearing the said piece
if(this == myhelm){
if(this == mychest){
if(this == mylegs){
if(this == myboots){
perform action
No no no no no. This is the format:
if() {
if() {
if(){
//etc...
}
}
}
But my code is right?
EDIT: DINT WORK -__- damn this really simple code stress me much
Fact: Using flint and steel on a creeper causes them to stop in place and blow up.
getArmorDisplay() is called for each piece of armor.
i did this code but it has 4 ticks and it sometimes cause lag could u help me by reducing the ticks to 1 ? or simplifying it
heres my code
It is causing lag because each piece is constantly performing this check. You're going to want to have once piece perform all checking.
Could u show me an example how to make it into one piece i cant really solve it please
i am ahad5522 its my minecraft server name i want change my skin
Pick any random piece you want to have perform the check. Create an if() statement to see if the player is wearing said piece. Inside of that if statement then check for the rest of the armor.
Wrong post/forum to ask in.
Im sorry if i misinterpret
if(boots == null || legs == null || chest == null || helmet == null || boots.getItem != BaseMyMod.rubyboots || legs.getItem != BaseMyMod.rubylegs || chest.getItem != BaseMyMod.rubychest || helmet.getItem != BaseMyMod.rubyhelmet){
But if you have many differnts armor sets that allows you to fly(example) you need to make longer if statement to include this armor...
Check out all my mods here: Link Removed!
Yes
That code needs to be inside of a Tick Handler or else it will never be called. The armor tick update method is only called while the armor is worn.
So heres what will i do .
No no no no no. This is the format:
Of course it must be written inside the Tick handler. I just showed what you must add inside Tick Handler;(i was lazy to copy all code there)
Check out all my mods here: Link Removed!
But my code is right?
EDIT: DINT WORK -__- damn this really simple code stress me much
heres what i got
Do not use this == for everything. Only for the first if() statement. Then after that check the players armor slots.