Jump to content

MikaXD

Members
  • Posts

    81
  • Joined

  • Last visited

Everything posted by MikaXD

  1. Ok, thanks!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2. Ok, how could I make an animation? Can I easily add a .mcmeta file to the texture file of the gui?
  3. Ok, Minecraft draws something on the screen, but my gui texture is never found. 2 Questions: 1. Can I also draw an animation on the screen? 2. Can I pause the game without showing the pause menu?
  4. Does anyone know, how to make a new bar? I mean, something like the hunger bar or the health bar. Is this possible? What do I need? PS: The Thirst Mod also adds a new bar...
  5. Hi, does Minecraft Forge has a player death event? I want to get the player who died and the killer of the player. Is this possible? I know, how to do this in Bukktit, but I didn't find anything in Minecraft Forge. Can anyone help me?
  6. MikaXD

    StoneWall

    "p_i45435_1_" is only the name of the variable of the type block. You can easily change it to "block" or something like this...
  7. How can I do this? I already added a command, but I have no idea, how to add parameters to it. Like /give <Player> <ID> [Amount] Here's my code for the command: package de.minecraft.commands; import java.util.List; import net.minecraft.command.CommandBase; import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.util.ChatComponentText; import net.minecraft.util.ChatStyle; import net.minecraft.util.IChatComponent; public class SampleCommand extends CommandBase { @Override public String getCommandName() { // TODO Auto-generated method stub return "test"; } @Override public String getCommandUsage(ICommandSender var1) { // TODO Auto-generated method stub return "/test"; } @Override public void processCommand(ICommandSender sender, String[] var2) { //... } } and in the main class: @EventHandler public void serverLoad(FMLServerStartingEvent event) { MinecraftServer server = MinecraftServer.getServer(); ICommandManager command = server.getCommandManager(); ServerCommandManager manager = (ServerCommandManager) command; manager.registerCommand(new SampleCommand()); } Can anyone help?
  8. Is there a special methode to do this?
  9. I think your path relative to your gradlew.bat-file should look like this: /src/main/java/sigurd4/... Normally when you set up your workspace, forge creates automatically a /src/main/-folder which contains the java folder and the resources folder. If this is the problem, go to http://files.minecraftforge.net and download the recommended version. Then create a new workspace, put in all the files, ... Then copy all your classes from /src/sigurd4/com/sigurd4/Bioshock to your new workspace to /src/main/java/sigurd4/... If there is no src/main folder, the gradlew file cannot find your main class.
  10. There is no @ForgeSubscribe annotation ...
  11. Ok, thanks, but how can I put this into my class? I want to use it, if the player wears the full armor. Here is the code: package de.mod.minecraft.items; import java.util.List; import com.sun.corba.se.impl.javax.rmi.CORBA.Util; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import Main; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemArmor.ArmorMaterial; import net.minecraft.potion.PotionEffect; import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.EnumSkyBlock; import net.minecraft.world.World; public class ObsidianArmor extends ItemArmor { public ObsidianArmor(ArmorMaterial material, int id,int typ) { super(material, id, typ); this.setCreativeTab(CreativeTabs.tabCombat); } @Override public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { if(stack.getItem() == Main.obsidianHelmet || stack.getItem() == Main.obsidianChestplate || stack.getItem() == Main.obsidianBoots) { return Main.MODID+":textures/models/armor/obsidianArmor1.png"; } if(stack.getItem() == Main.obsidianLeggins) { return Main.MODID+":textures/models/armor/obsidianArmor2.png"; } else { return null; } } @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister par1){ if(this == Main.obsidianHelmet){ this.itemIcon = par1.registerIcon(Main.MODID+":obsidianHelmet"); } if(this == Main.obsidianChestplate){ this.itemIcon = par1.registerIcon(Main.MODID+":obsidianChestplate"); } if(this == Main.obsidianLeggins){ this.itemIcon = par1.registerIcon(Main.MODID+":obsidianLeggins"); } if(this == Main.obsidianBoots){ this.itemIcon = par1.registerIcon(Main.MODID+":obsidianBoots"); } } @Override public void onArmorTick(World world, EntityPlayer player,ItemStack itemStack) { super.onArmorTick(world, player, itemStack); // ItemStack helmet = player.getCurrentArmor(3); ItemStack chestplate = player.getCurrentArmor(2); ItemStack leggins = player.getCurrentArmor(1); ItemStack boots = player.getCurrentArmor(0); //returns true if the player wears the armor if(helmet != null && helmet.getItem()==Main.obsidianHelmet && chestplate != null && chestplate.getItem() == Main.obsidianChestplate && leggins != null && leggins.getItem()==Main.obsidianLeggins && boots != null && boots.getItem() == Main.obsidianBoots){ ... } } } I want, that the player gets no damage, when he's hit by an arrow and wearing the whole armor (in this case, it's the obsidian armor). Thanks in advance...
  12. Hi, is there a methode, that detects, when a player is hit by an arrow? Just as an Enderman... (it changes its position when it's hit by an arrow. Does anyone has an idea? PS: Sorry for my bad English...
  13. Hi, I'm trying to add a new bow to the game, but Minecraft doesn't renders the arrow when I start to span the bow. Here's my code: main-file: public static Item obsidianBow = new ObsidianBow(); GameRegistry.registerItem(obsidianBow, "obsidianBow"); Bow-class: import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import de.mod.minecraft.Main; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.init.Items; import net.minecraft.item.EnumAction; import net.minecraft.item.Item; import net.minecraft.item.ItemBow; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.ArrowLooseEvent; import net.minecraftforge.event.entity.player.ArrowNockEvent; public class ObsidianBow extends ItemBow { public static final String[] bowPullIconNameArray = new String[] {Main.MODID + ":" + "obsidianBow1", Main.MODID + ":" + "obsidianBow2", Main.MODID + ":" + "obsidianBow3"}; @SideOnly(Side.CLIENT) private IIcon[] iconArray; private static final String __OBFID = "CL_00001777"; public ObsidianBow() { this.maxStackSize = 1; this.setMaxDamage(384); this.setCreativeTab(CreativeTabs.tabCombat); this.setUnlocalizedName("obsidianBow"); } public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4) { int j = this.getMaxItemUseDuration(par1ItemStack) - par4; ArrowLooseEvent event = new ArrowLooseEvent(par3EntityPlayer, par1ItemStack, j); MinecraftForge.EVENT_BUS.post(event); if (event.isCanceled()) { return; } j = event.charge; boolean flag = par3EntityPlayer.capabilities.isCreativeMode || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, par1ItemStack) > 0; if (flag || par3EntityPlayer.inventory.hasItem(Items.arrow)) { float f = (float)j / 20.0F; f = (f * f + f * 2.0F) / 3.0F; if ((double)f < 0.1D) { return; } if (f > 1.0F) { f = 1.0F; } EntityArrow entityarrow = new EntityArrow(par2World, par3EntityPlayer, f * 2.0F); if (f == 1.0F) { entityarrow.setIsCritical(true); } int k = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, par1ItemStack); if (k > 0) { entityarrow.setDamage(entityarrow.getDamage() + (double)k * 0.5D + 0.5D); } int l = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, par1ItemStack); if (l > 0) { entityarrow.setKnockbackStrength(l); } if (EnchantmentHelper.getEnchantmentLevel(Enchantment.flame.effectId, par1ItemStack) > 0) { entityarrow.setFire(100); } par1ItemStack.damageItem(1, par3EntityPlayer); par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + f * 0.5F); if (flag) { entityarrow.canBePickedUp = 2; } if (!par2World.isRemote) { par2World.spawnEntityInWorld(entityarrow); } } } public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { return par1ItemStack; } public int getMaxItemUseDuration(ItemStack par1ItemStack) { return 72000; } public EnumAction getItemUseAction(ItemStack par1ItemStack) { return EnumAction.bow; } public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { ArrowNockEvent event = new ArrowNockEvent(par3EntityPlayer, par1ItemStack); MinecraftForge.EVENT_BUS.post(event); if (event.isCanceled()) { return event.result; } if (par3EntityPlayer.capabilities.isCreativeMode || par3EntityPlayer.inventory.hasItem(Items.arrow)) { par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); } return par1ItemStack; } public int getItemEnchantability() { return 1; } @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister par1IconRegister) { this.itemIcon = par1IconRegister.registerIcon(Main.MODID+":obsidianBow"); this.iconArray = new IIcon[bowPullIconNameArray.length]; for (int i = 0; i < this.iconArray.length; ++i) { this.iconArray[i] = par1IconRegister.registerIcon(bowPullIconNameArray[i]); } } @SideOnly(Side.CLIENT) public IIcon getItemIconForUseDuration(int par1) { return this.iconArray[par1]; } } Can anyone help me? PS: Sorry for my bad English, but I'm from Germany...
  14. Thanks, but there is a lot of code and when I paste it in my workspace (only for testing!) it doesn't work... I have already spent hours on it, but I haven't found a suitable solution. Can anyone give me the code with which it works? That would be very nice... :'(
  15. Hi, Can anyone help me? In Dynamic Lights Mod there are also torches that emit light when held in the hand. But I don't want to add this effect to the basic torch, I want to add it to my own Item... Do you have an idea? I'm using the recommend version of Forge 1.7.2 if that helps...
×
×
  • Create New...

Important Information

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