Oredictionary metals trees (copper, tin, bronze, lead, ferrous(nickel), silver, platinum (they are called oredict metals, because present in many mods and all are using oredictionary...)
There really aren't any mods updating to 1.8 which have these metals. It will come but not now. Any other suggestions?
That's basically all hunger is doing under the hood, but there is obviously more logic involved for determining when it should decrease (it actually uses two values, one for hunger and one for saturation, and hunger only starts to deplete when saturation is down).
The exact logic will depend on your system, and that's for you to design. I suggest you use your IDE to browse around the vanilla code, checking all the places that hunger is involved. You will learn a lot just by doing that.
Well, I have made something like a logic but some things does not work, can you help me with it? EventHndlerClass:
public class NeedsEventHandler {
int decreaseWithTime = 0;
@SubscribeEvent
public void onEntityConstructing(EntityConstructing event) {
if (event.entity instanceof EntityPlayer && WaterPlayerProperty.get((EntityPlayer) event.entity) == null)
WaterPlayerProperty.register((EntityPlayer) event.entity);
}
@SubscribeEvent
public void onLivingUpdate(LivingUpdateEvent event) {
if (event.entity instanceof EntityPlayer) {
WaterPlayerProperty props = WaterPlayerProperty.get((EntityPlayer) event.entity);
EnumDifficulty enumdifficulty = event.entity.worldObj.getDifficulty();
decreaseWithTime++;
if (decreaseWithTime >= 80 && enumdifficulty != EnumDifficulty.PEACEFUL) {
if (props.currentWater != 0) {
props.currentWater--;
}
if (props.currentWater < 1) {
System.out.println("NEEDS TO TAKE DAMAGE");
event.entity.attackEntityFrom(NeedsMod.Dehidrate, 1F);
}
if (event.entity.isDead) {
props.replenishWater();
}
decreaseWithTime = 0;
}
}
}
}
Everything works. Except taking damage. The timer works, decreasing property works and event check where it sysout's that player needs to take damage works, but player isn't getting damage, only sometimes, it may work once but does not work second time. I have own damage source, but that isn't causing it, because i have tested it with built in ones and does the same thing. Why could it happen(btw sorry for bad english)
That's basically all hunger is doing under the hood, but there is obviously more logic involved for determining when it should decrease (it actually uses two values, one for hunger and one for saturation, and hunger only starts to deplete when saturation is down).
The exact logic will depend on your system, and that's for you to design. I suggest you use your IDE to browse around the vanilla code, checking all the places that hunger is involved. You will learn a lot just by doing that.
0
There really aren't any mods updating to 1.8 which have these metals. It will come but not now. Any other suggestions?
0
So... Dear users of mod. I need suggestions on what to do in next update. Give me some
0
No Problem!
0
Thanks!
0
are you sure that you aren't on peaceful mode? if not which boss is doing that.
0
IT'S OUT!
0
1.8 is coming! if not today, it will be out tomorrow!
0
Well, I have made something like a logic but some things does not work, can you help me with it? EventHndlerClass:
public class NeedsEventHandler {
int decreaseWithTime = 0;
@SubscribeEvent
public void onEntityConstructing(EntityConstructing event) {
if (event.entity instanceof EntityPlayer && WaterPlayerProperty.get((EntityPlayer) event.entity) == null)
WaterPlayerProperty.register((EntityPlayer) event.entity);
}
@SubscribeEvent
public void onLivingUpdate(LivingUpdateEvent event) {
if (event.entity instanceof EntityPlayer) {
WaterPlayerProperty props = WaterPlayerProperty.get((EntityPlayer) event.entity);
EnumDifficulty enumdifficulty = event.entity.worldObj.getDifficulty();
decreaseWithTime++;
if (decreaseWithTime >= 80 && enumdifficulty != EnumDifficulty.PEACEFUL) {
if (props.currentWater != 0) {
props.currentWater--;
}
if (props.currentWater < 1) {
System.out.println("NEEDS TO TAKE DAMAGE");
event.entity.attackEntityFrom(NeedsMod.Dehidrate, 1F);
}
System.out.println("[currentWater]" + props.getCurrentWater());
if (event.entity.isDead) {
props.replenishWater();
}
decreaseWithTime = 0;
}
}
}
}
Everything works. Except taking damage. The timer works, decreasing property works and event check where it sysout's that player needs to take damage works, but player isn't getting damage, only sometimes, it may work once but does not work second time. I have own damage source, but that isn't causing it, because i have tested it with built in ones and does the same thing. Why could it happen(btw sorry for bad english)
0
Thanks! That should do! Great tutorials btw.
0
coolAlias do you know how to make property which decreases like hunger does? by itself, from time to time.
0
Guys! I need a tester. Does anyone want it?
0
It's coming soon.(very soon)
0
why can't you?
0
Well, I'll figure something out.
0
I just want to make mod more balanced. It was little bit op in the past