Jump to content

SamTheBro

Members
  • Posts

    8
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

SamTheBro's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. in the server tick handler: package SamTheBro1704.afterearthmod; import java.util.EnumSet; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import cpw.mods.fml.common.ITickHandler; import cpw.mods.fml.common.TickType; public class ServerTickHandler implements ITickHandler { public void onPlayerTick(EntityPlayer player) { if(player.getCurrentItemOrArmor(3) != null) { ItemStack Chestplate = player.getCurrentItemOrArmor(3); if(Chestplate.getItem() == AfterEarthMod.TitaniumChestplate){ player.addPotionEffect((new PotionEffect(Potion.fireResistance.getId(), 20, 1))); player.addPotionEffect((new PotionEffect(Potion.damageBoost.getId(), 20, 1))); } } if(player.getCurrentItemOrArmor(1) != null) { ItemStack Boots = player.getCurrentItemOrArmor(1); if(Boots.getItem() == AfterEarthMod.TitaniumBoots){ player.addPotionEffect((new PotionEffect(Potion.fireResistance.getId(), 20, 1))); } } if(player.getCurrentItemOrArmor(2) != null) { ItemStack Leggings = player.getCurrentItemOrArmor(2); if(Leggings.getItem() == AfterEarthMod.TitaniumLeggins){ player.addPotionEffect((new PotionEffect(Potion.fireResistance.getId(), 20, 1))); } } if(player.getCurrentItemOrArmor(4) != null) { ItemStack Helmet = player.getCurrentItemOrArmor(4); if(Helmet.getItem() == AfterEarthMod.TitaniumHelmet){ player.addPotionEffect((new PotionEffect(Potion.fireResistance.getId(), 20, 1))); } } if(player.getCurrentItemOrArmor(1) != null) { ItemStack Boots = player.getCurrentItemOrArmor(1); if(Boots.getItem() == AfterEarthMod.EnergyBoots){ player.addPotionEffect((new PotionEffect(Potion.moveSpeed.getId(), 20, 1))); } } if(player.getCurrentItemOrArmor(3) != null) { ItemStack Chestplate = player.getCurrentItemOrArmor(3); if(Chestplate.getItem() == AfterEarthMod.EnergyChestplate){ player.addPotionEffect((new PotionEffect(Potion.heal.getId(), 20, 0))); player.addPotionEffect((new PotionEffect(Potion.moveSpeed.getId(), 20, 1))); } } if(player.getCurrentItemOrArmor(2) != null) { ItemStack Leggings = player.getCurrentItemOrArmor(2); if(Leggings.getItem() == AfterEarthMod.EnergyLeggins){ player.addPotionEffect((new PotionEffect(Potion.moveSpeed.getId(), 20, 1))); } } if(player.getCurrentItemOrArmor(4) != null) { ItemStack Helmet = player.getCurrentItemOrArmor(4); if(Helmet.getItem() == AfterEarthMod.EnergyHelmet){ player.addPotionEffect((new PotionEffect(Potion.moveSpeed.getId(), 20, 1))); } } } @Override public void tickStart(EnumSet<TickType> type, Object... tickData) { if(type.equals(EnumSet.of(TickType.PLAYER))) { onPlayerTick((EntityPlayer) tickData[0]); } // TODO Auto-generated method stub } @Override public void tickEnd(EnumSet<TickType> type, Object... tickData) { // TODO Auto-generated method stub } @Override public EnumSet<TickType> ticks() { // TODO Auto-generated method stub return EnumSet.of(TickType.PLAYER, TickType.SERVER); } @Override public String getLabel() { // TODO Auto-generated method stub return null; } } I made a common proxy then eclipse says, that i must create a methode in the ClientProxy class. Since then it did not work. In the main mod class: @EventHandler public void load(FMLInitializationEvent event) { proxy.registerRenderThings(); proxy.registerServerTickHandler(); } and: public static ClientProxy proxy; in the ClientProxy class is also a methode: public void registerServerTickHandler() { // TODO Auto-generated method stub }
  2. Hello I made a mod with lots of armor. Some off the armor have a potion effects. But yesterday I made a "CommonProxy" class and changed some things in the main mod class. But now the armor has no potion effect any more. When I created the common proxy class, eclipse said that the proxy.registerServerTickHandler is false. I created a methode in the CommonProxy class, but then the effects were gone pls help me
  3. Hello guys I am making a mod but there is one problem. The texture code does not work. I am using the code: .setTextureName("nameofmymod:texture.png"); But every time when I start the game, there is a pink-black Missing Texture Are there other codes? Pls help me
  4. It should give stack3 (the weapon) an enchantment
  5. Hello, guys, I have a problem: How can I give my weapons an enchantment. i am using the code Itemstack stack3 = new Itemstack(Weapon, 1); stack3.addEnchantment(...); any ideas?
  6. hello, I have a question. Where can I lern GOOD java and forge(I know the basics, but I need a bit more)? It should be simple because my mother tongue is not english Pls help me
  7. I think the public boolean hasEffect() { return true; } is only for shine effects, or am I wrong?
  8. Hello, I have a question How can I give my bow an enchantment effect? The basic of my code is: ItemStack example = new Itemstack(ExampleBow, 1); example.addEnchantment(Enchantment.jdfhd, 1); In the main mod class is already a code. (Like a crafting recipe) but there is no enchantment. Maybe it is becuase, there is no texture for the bow.... I have no idea
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.