The Meaning of Life, the Universe, and Everything.
Join Date:
11/29/2015
Posts:
61
Member Details
sorry i forgot to say i work best with pictures i am so sorry i didnt say this form the start/
i do understand what i need to do but i work best when i can see a full on expamle code if this working so that i have guild line to follow if you know what it mean.
I don't mean to be rude, that's all well and good, but not everything's going to be in pictures. You can't expect this all to just be a walk in the park.
You can try look for a YouTube video tutorial or something, but most tutorials are in text (some rarely with pictures) but if you want to learn you'll need to read and try stuff out. You'll be able to see the result once you've made it.
The Meaning of Life, the Universe, and Everything.
Join Date:
11/29/2015
Posts:
61
Member Details
by pictures i mean text i am sorry i didnt make that clear if i had example code to look at then i would know what i did wrong and this fix my mistakes
Well there's not example code for exactly your situation. If there was, then it probably means someone has already made exactly what you're doing.
Most tutorials show example code for what you're learning, so just use that and explore the classes you're using. You're going to have to experiment a bit - it's all part of learning programming and more specifically, modding. If you have a very particular issue, then fire away, but atm you're just trying to create an event handler... and there's plenty of tutorials for that.
The Meaning of Life, the Universe, and Everything.
Join Date:
11/29/2015
Posts:
61
Member Details
i dont think anyone understands what i am trying to say i am looking ofr someone to work on the dungeons and dragon combat mod with me i need help coding the rng so that it work the way i want it to ok
i dont think anyone understands what i am trying to say i am looking ofr someone to work on the dungeons and dragon combat mod with me i need help coding the rng so that it work the way i want it to ok
You should really have clarified that properly from the beginning then... Because you started saying you need help with 1 particular issue and then explained it. You didn't sound at all like you're trying to recruit someone to work on the mod.
As for that code, you've created your random number, but you're not doing anything with it... You need to actually change the attack damage in the event.
Just had a look at the events properly (I was relying on the person who posted the idea initially), you should use LivingHurtEvent where it then has a method to set the attack damage.
Well I've seen some people post on this section before for that sort of thing. Just make sure you actually write your post and title for recruiting people rather than saying you have an issue.
Just had a look at the events properly (I was relying on the person who posted the idea initially), you should use LivingHurtEvent where it then has a method to set the attack damage.
Apologies for misleading you, I didn't have access to the source at the time.
sorry i forgot to say i work best with pictures i am so sorry i didnt say this form the start/
i do understand what i need to do but i work best when i can see a full on expamle code if this working so that i have guild line to follow if you know what it mean.
I don't mean to be rude, that's all well and good, but not everything's going to be in pictures. You can't expect this all to just be a walk in the park.
You can try look for a YouTube video tutorial or something, but most tutorials are in text (some rarely with pictures) but if you want to learn you'll need to read and try stuff out. You'll be able to see the result once you've made it.
by pictures i mean text i am sorry i didnt make that clear if i had example code to look at then i would know what i did wrong and this fix my mistakes
Well there's not example code for exactly your situation. If there was, then it probably means someone has already made exactly what you're doing.
Most tutorials show example code for what you're learning, so just use that and explore the classes you're using. You're going to have to experiment a bit - it's all part of learning programming and more specifically, modding. If you have a very particular issue, then fire away, but atm you're just trying to create an event handler... and there's plenty of tutorials for that.
ok ?
i dont think anyone understands what i am trying to say i am looking ofr someone to work on the dungeons and dragon combat mod with me i need help coding the rng so that it work the way i want it to ok
@SubscribeEvent(priority = EventPriority.HIGH)
public void livingAttack(LivingAttackEvent e)
{
e.source.damageType.Random rand = new Random();
float num = rand.nextFloat()*6 + 3;
}
whats wroung with it
You should really have clarified that properly from the beginning then... Because you started saying you need help with 1 particular issue and then explained it. You didn't sound at all like you're trying to recruit someone to work on the mod.
As for that code, you've created your random number, but you're not doing anything with it... You need to actually change the attack damage in the event.
how would you go about doing that?
package jmanz7.DandDWeaponsMod.item;
import java.util.Random;
import cpw.mods.fml.common.eventhandler.EventPriority;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
import net.minecraftforge.event.entity.living.LivingAttackEvent;
public class ItemFireMace extends ItemSword
{
@SubscribeEvent(priority = EventPriority.HIGH)
public void livingAttack(LivingAttackEvent e)
{
e.source.damageType.Random rand = new Random();
float entityLiving = rand.nextFloat()*6 + 3;
}
public ItemFireMace(ToolMaterial material)
{
super(material);
}
public float getDamageVsEntity()
{
return this.getDamageVsEntity();
}
@Override
public boolean hitEntity(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker)
{
//Random rand = new Random();
//float num = rand.nextFloat()*6 + 3;
//target.attackEntityFrom(DamageSource.generic, num);
return true;
}
}
i want to point out that the moding tutorial i watched didn't have me create proxies
i watched mr. crayfish 1..10 moding tutorials
Just had a look at the events properly (I was relying on the person who posted the idea initially), you should use LivingHurtEvent where it then has a method to set the attack damage.
i dont know the correct method?
Have you tried having a look at the event class? It's pretty obvious... it's the only method you can use to set something.
where would mi post if i want to ask if people want to join my mod dev team
Well I've seen some people post on this section before for that sort of thing. Just make sure you actually write your post and title for recruiting people rather than saying you have an issue.
ok
Apologies for misleading you, I didn't have access to the source at the time.
If I helped you, please click the green up arrow.
its ok i am looking for people to help me work on the mod