The parameters damage and accuracy are ints, so add those parameters to the ItemGun constructor. Your ItemGun class should have 2 private ints (damage and accuracy) and the constructor should include the ints like this:
public class ItemGun extends Item implements ITextureProvider
{
private int damage;
private int accuracy;
private Item clip;
private int rateOfFire;
private int recoil;
private int reloadTime;
private int shootDelay;
public String type;
private String sound;
private static boolean mouseHeld;
private static boolean lastMouseHeld;
/**
*
* @param i the id of the gun
* @param l damage of bullte (in half hears)
* @param i1 accuracy of bullet (doesn't seem to be a factor, due to EntityBullet code
* @param item bullet (or might be changed to clip) that provides ammo
* @param rof rate of fire while the right mouse is being held down, doesn't do anything if rapid right click
* @param j recoil of gun
* @param k reload time of gun in ticks
* @param p time between shots
* @param type type of gun, can't seem to get this to do anything
* @param s sound the gun plays, again I can't seem to get this to do anything
*/
public ItemGun(int i, int l, int i1, Item item, int rof, int j, int k, int p, String s, String s1)
{
super(i);
maxStackSize = 1;
damage = l;
//TODO fix the accuracy not having affect
accuracy = i1;
clip = item;
rateOfFire = rof;
recoil = j;
reloadTime = k;
shootDelay = p;
type = s;
sound = s1;
}
Edit: that ITextureProvider is only if you are using forge.
public class ItemGun extends Item implements
{
private int damage;
private int accuracy;
private Item clip;
private int rateOfFire;
private int recoil;
private int reloadTime;
private int shootDelay;
public String type;
private String sound;
private static boolean mouseHeld;
private static boolean lastMouseHeld;
/**
*
* @param i the id of the gun
* @param l damage of bullte (in half hears)
* @param i1 accuracy of bullet (doesn't seem to be a factor, due to EntityBullet code
* @param item bullet (or might be changed to clip) that provides ammo
* @param rof rate of fire while the right mouse is being held down, doesn't do anything if rapid right click
* @param j recoil of gun
* @param k reload time of gun in ticks
* @param p time between shots
* @param type type of gun, can't seem to get this to do anything
* @param s sound the gun plays, again I can't seem to get this to do anything
*/
public ItemGun(int i, int l, int i1, Item item, int rof, int j, int k, int p, String s, String s1)
{
super(i);
maxStackSize = 1;
damage = l;
//TODO fix the accuracy not having affect
accuracy = i1;
clip = item;
rateOfFire = rof;
recoil = j;
reloadTime = k;
shootDelay = p;
type = s;
sound = s1;
}
Mod_*****:
package net.minecraft.src;
public class mod_***** extends BaseMod{
public static final Item pistolclip = new Item(386).setItemName("Pistol Clip");
public static final Item pistol = new ItemGun(387, (byte)5).setItemName("Gun");
public void load(){
pistolclip.iconIndex = ModLoader.addOverride("/gui/items.png", "/zombiecraft/Item/magnum.png");
pistol.iconIndex = ModLoader.addOverride("/gui/items.png", "/zombiecraft/Item/magnum.png");
ModLoader.addName(pistolclip, "Pistol Mag");
ModLoader.addName(pistol, "Magnum");
//I added some 'Cheat' recipies XD. Just so I don't have to get resources in survival to test lol
ModLoader.addRecipe(new ItemStack(Item.ingotIron, 64), new Object[]{
"##", Character.valueOf('#'), Block.dirt
});
ModLoader.addRecipe(new ItemStack(Item.gunpowder, 64), new Object[]{
" # ", "###", "###", Character.valueOf('#'), Block.dirt
});
ModLoader.addShapelessRecipe(new ItemStack(pistolclip, 10), new Object[]{
Item.gunpowder, Item.ingotIron
});
ModLoader.addRecipe(new ItemStack(pistol, 1), new Object[]{
"###", " #", " #", Character.valueOf('#'), Item.ingotIron
});
}
public String getVersion(){
return "1.2.5";
}
}
I will change somethings,like names rates of speed,but...
public ItemGun(int i, int l, int i1, Item item, int rof, int j, int k, int p, String s, String s1)
{
super(i);
maxStackSize = 1;
damage = l;
//This works in ModLoader?
accuracy = i1; //All this things will work Normaly?
clip = item;
rateOfFire = rof;
recoil = j;
reloadTime = k;
shootDelay = p;
type = s;
sound = s1;
}
This will work?:
super(i);
maxStackSize = 1;
damage = 5;
accuracy = 11; //This works?
clip = 7;
rateOfFire = 10;
recoil = 10;
reloadTime = 12;
shootDelay = 10;
type = s;
sound = s1
Thank you and
sorry for my bad inglish
The parameters damage and accuracy are ints, so add those parameters to the ItemGun constructor. Your ItemGun class should have 2 private ints (damage and accuracy) and the constructor should include the ints like this:
public class ItemGun extends Item implements
{
private int damage;
private int accuracy;
private Item clip;
private int rateOfFire;
private int recoil;
private int reloadTime;
private int shootDelay;
public String type;
private String sound;
private static boolean mouseHeld;
private static boolean lastMouseHeld;
/**
*
* @param i the id of the gun
* @param l damage of bullte (in half hears)
* @param i1 accuracy of bullet (doesn't seem to be a factor, due to EntityBullet code
* @param item bullet (or might be changed to clip) that provides ammo
* @param rof rate of fire while the right mouse is being held down, doesn't do anything if rapid right click
* @param j recoil of gun
* @param k reload time of gun in ticks
* @param p time between shots
* @param type type of gun, can't seem to get this to do anything
* @param s sound the gun plays, again I can't seem to get this to do anything
*/
public ItemGun(int i, int l, int i1, Item item, int rof, int j, int k, int p, String s, String s1)
{
super(i);
maxStackSize = 1;
damage = l;
//TODO fix the accuracy not having affect
accuracy = i1;
clip = item;
rateOfFire = rof;
recoil = j;
reloadTime = k;
shootDelay = p;
type = s;
sound = s1;
}
Edit: that ITextureProvider is only if you are using forge.
public class ItemGun extends Item implements
{
private int damage;
private int accuracy;
private Item clip;
private int rateOfFire;
private int recoil;
private int reloadTime;
private int shootDelay;
public String type;
private String sound;
private static boolean mouseHeld;
private static boolean lastMouseHeld;
/**
*
* @param i the id of the gun
* @param l damage of bullte (in half hears)
* @param i1 accuracy of bullet (doesn't seem to be a factor, due to EntityBullet code
* @param item bullet (or might be changed to clip) that provides ammo
* @param rof rate of fire while the right mouse is being held down, doesn't do anything if rapid right click
* @param j recoil of gun
* @param k reload time of gun in ticks
* @param p time between shots
* @param type type of gun, can't seem to get this to do anything
* @param s sound the gun plays, again I can't seem to get this to do anything
*/
public ItemGun(int i, int l, int i1, Item item, int rof, int j, int k, int p, String s, String s1)
{
super(i);
maxStackSize = 1;
damage = l;
//TODO fix the accuracy not having affect
accuracy = i1;
clip = item;
rateOfFire = rof;
recoil = j;
reloadTime = k;
shootDelay = p;
type = s;
sound = s1;
}
Mod_*****:
package net.minecraft.src;
public class mod_***** extends BaseMod{
public static final Item pistolclip = new Item(386).setItemName("Pistol Clip");
public static final Item pistol = new ItemGun(387, (byte)5).setItemName("Gun");
public void load(){
pistolclip.iconIndex = ModLoader.addOverride("/gui/items.png", "/zombiecraft/Item/magnum.png");
pistol.iconIndex = ModLoader.addOverride("/gui/items.png", "/zombiecraft/Item/magnum.png");
ModLoader.addName(pistolclip, "Pistol Mag");
ModLoader.addName(pistol, "Magnum");
//I added some 'Cheat' recipies XD. Just so I don't have to get resources in survival to test lol
ModLoader.addRecipe(new ItemStack(Item.ingotIron, 64), new Object[]{
"##", Character.valueOf('#'), Block.dirt
});
ModLoader.addRecipe(new ItemStack(Item.gunpowder, 64), new Object[]{
" # ", "###", "###", Character.valueOf('#'), Block.dirt
});
ModLoader.addShapelessRecipe(new ItemStack(pistolclip, 10), new Object[]{
Item.gunpowder, Item.ingotIron
});
ModLoader.addRecipe(new ItemStack(pistol, 1), new Object[]{
"###", " #", " #", Character.valueOf('#'), Item.ingotIron
});
}
public String getVersion(){
return "1.2.5";
}
}
I will change somethings,like names rates of speed,but...
public class ItemGun extends Item implements
{
private int damage;
private int accuracy;
private Item clip;
private int rateOfFire;
private int recoil;
private int reloadTime;
private int shootDelay;
public String type;
private String sound;
private static boolean mouseHeld;
private static boolean lastMouseHeld;
/**
*
* @param i the id of the gun
* @param l damage of bullte (in half hears)
* @param i1 accuracy of bullet (doesn't seem to be a factor, due to EntityBullet code
* @param item bullet (or might be changed to clip) that provides ammo
* @param rof rate of fire while the right mouse is being held down, doesn't do anything if rapid right click
* @param j recoil of gun
* @param k reload time of gun in ticks
* @param p time between shots
* @param type type of gun, can't seem to get this to do anything
* @param s sound the gun plays, again I can't seem to get this to do anything
*/
public ItemGun(int i, int l, int i1, Item item, int rof, int j, int k, int p, String s, String s1)
{
super(i);
maxStackSize = 1;
damage = l;
//This works in ModLoader?
accuracy = i1; //All this things will work Normaly?
clip = item;
rateOfFire = rof;
recoil = j;
reloadTime = k;
shootDelay = p;
type = s;
sound = s1;
}
This will work?: public class ItemGun extends Item implements
{
private int damage;
private int accuracy;
private Item clip;
private int rateOfFire;
private int recoil;
private int reloadTime;
private int shootDelay;
public String type;
private String sound;
private static boolean mouseHeld;
private static boolean lastMouseHeld;
/**
*
* @param i the id of the gun
* @param l damage of bullte (in half hears)
* @param i1 accuracy of bullet (doesn't seem to be a factor, due to EntityBullet code
* @param item bullet (or might be changed to clip) that provides ammo
* @param rof rate of fire while the right mouse is being held down, doesn't do anything if rapid right click
* @param j recoil of gun
* @param k reload time of gun in ticks
* @param p time between shots
* @param type type of gun, can't seem to get this to do anything
* @param s sound the gun plays, again I can't seem to get this to do anything
*/
super(i);
maxStackSize = 1;
damage = 5;
accuracy = 11; //This works?
clip = 7;
rateOfFire = 10;
recoil = 10;
reloadTime = 12;
shootDelay = 10;
type = s;
sound = s1
Thank you and
sorry for my bad inglish
That fast? use scheduleblockupdate(x,y,z,blockid, time in ticks). Its in world.class Or, if you use modloader, there is the
onTickInGame(float var1, Minecraft var2)
method, but you have to have ModLoader.setInGameHook(this, true, true); in the load(). Not sure how to use it outside of your mod_****.class, though.
If you use the setblockwithnotify(x,y,z,blockid) method to spread, you get massive lag with something spreading this fast. Also, wrap setblock with if(!remote) to help with crazy glitches.
o problem, Im sure I could just whip up a written tutorial. Staring a new program..written tutorials by myself and some of my subscribers. That im sure will come up soon.
Ok,
thank you the insitutions.
Your tutorials are awesomes and helped me so much...
The Instituitions,
You can make a tutorial of how to create a new explosion.class and customize then(algorithns,% of drops)
and how to use the new explosion.class in your TNT?
Sorry for bad inglish.
package net.minecraft.src;
import java.util.Random;
public class MoabExplosive extends Block
{
public MoabExplosive(int par1, int par2)
{
super(par1, par2, Material.tnt);
}
public void onBlockAdded(World par1World, int par2, int par3, int par4)
{
super.onBlockAdded(par1World, par2, par3, par4);
if (par1World.isBlockIndirectlyGettingPowered(par2, par3, par4))
{
onBlockDestroyedByPlayer(par1World, par2, par3, par4, 1);
par1World.setBlockWithNotify(par2, par3, par4, 0);
}
}
/**
* Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are
* their own) Args: x, y, z, neighbor blockID
*/
public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5)
{
if (par5 > 0 && Block.blocksList[par5].canProvidePower() && par1World.isBlockIndirectlyGettingPowered(par2, par3, par4))
{
onBlockDestroyedByPlayer(par1World, par2, par3, par4, 1);
par1World.setBlockWithNotify(par2, par3, par4, 0);
}
}
/**
* Returns the quantity of items to drop on block destruction.
*/
public int quantityDropped(Random par1Random)
{
return 0;
}
/**
* Called upon the block being destroyed by an explosion
*/
public void onBlockDestroyedByExplosion(World par1World, int par2, int par3, int par4)
{
if (par1World.isRemote)
{
return;
}
else
{
EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(par1World, (float)par2 + 0.5F, (float)par3 + 0.5F, (float)par4 + 0.5F);
entitytntprimed.fuse = par1World.rand.nextInt(entitytntprimed.fuse / 4) + entitytntprimed.fuse / 8;
par1World.spawnEntityInWorld(entitytntprimed);
return;
}
}
/**
* Called right before the block is destroyed by a player. Args: world, x, y, z, metaData
*/
public void onBlockDestroyedByPlayer(World par1World, int par2, int par3, int par4, int par5)
{
if (par1World.isRemote)
{
return;
}
if ((par5 & 1) == 0)
{
dropBlockAsItem_do(par1World, par2, par3, par4, new ItemStack(Block.tnt.blockID, 1, 0));
}
else
{
EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(par1World, (float)par2 + 0.5F, (float)par3 + 0.5F, (float)par4 + 0.5F);
par1World.spawnEntityInWorld(entitytntprimed);
par1World.playSoundAtEntity(entitytntprimed, "random.fuse", 1.0F, 1.0F);
}
}
/**
* Called when the block is clicked by a player. Args: x, y, z, entityPlayer
*/
public void onBlockClicked(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer)
{
super.onBlockClicked(par1World, par2, par3, par4, par5EntityPlayer);
}
/**
* Called upon block activation (left or right click on the block.). The three integers represent x,y,z of the
* block.
*/
public boolean blockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer)
{
if (par5EntityPlayer.getCurrentEquippedItem() != null && par5EntityPlayer.getCurrentEquippedItem().itemID == Item.flintAndSteel.shiftedIndex)
{
onBlockDestroyedByPlayer(par1World, par2, par3, par4, 1);
par1World.setBlockWithNotify(par2, par3, par4, 0);
return true;
}
else
{
return super.blockActivated(par1World, par2, par3, par4, par5EntityPlayer);
}
}
/**
* Returns an item stack containing a single instance of the current block type. 'i' is the block's subtype/damage
* and is ignored for blocks which do not support subtypes. Blocks which cannot be harvested should return null.
*/
protected ItemStack createStackedBlock(int par1)
{
return null;
}
}
MoabCaller:
package net.minecraft.src;
public class MoabCaller extends Item
{
public MoabCaller(int i)
{
super(i);
maxStackSize = 1;
}
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer)
{
if(!world.isRemote)
{
EntityMoabPrimed tnt= new EntityMoabPrimed(world, entityplayer.posX, entityplayer.posY, entityplayer.posZ);
world.spawnEntityInWorld(tnt);
}
return itemstack;
}
{
}
}
If you know the solution please help me,and sorry for bad inglish.
0
And sorry for bad inglish.
0
0
This work(In ModLoader)?:
EntityBullet:
ItemGun:
Mod_*****:
I will change somethings,like names rates of speed,but...
public ItemGun(int i, int l, int i1, Item item, int rof, int j, int k, int p, String s, String s1)
{
super(i);
maxStackSize = 1;
damage = l;
//This works in ModLoader?
accuracy = i1; //All this things will work Normaly?
clip = item;
rateOfFire = rof;
recoil = j;
reloadTime = k;
shootDelay = p;
type = s;
sound = s1;
}
This will work?:
super(i);
maxStackSize = 1;
damage = 5;
accuracy = 11; //This works?
clip = 7;
rateOfFire = 10;
recoil = 10;
reloadTime = 12;
shootDelay = 10;
type = s;
sound = s1
Thank you and
sorry for my bad inglish
This work(In ModLoader)?:
EntityBullet:
ItemGun:
Mod_*****:
I will change somethings,like names rates of speed,but...
public class ItemGun extends Item implements
{
private int damage;
private int accuracy;
private Item clip;
private int rateOfFire;
private int recoil;
private int reloadTime;
private int shootDelay;
public String type;
private String sound;
private static boolean mouseHeld;
private static boolean lastMouseHeld;
/**
*
* @param i the id of the gun
* @param l damage of bullte (in half hears)
* @param i1 accuracy of bullet (doesn't seem to be a factor, due to EntityBullet code
* @param item bullet (or might be changed to clip) that provides ammo
* @param rof rate of fire while the right mouse is being held down, doesn't do anything if rapid right click
* @param j recoil of gun
* @param k reload time of gun in ticks
* @param p time between shots
* @param type type of gun, can't seem to get this to do anything
* @param s sound the gun plays, again I can't seem to get this to do anything
*/
public ItemGun(int i, int l, int i1, Item item, int rof, int j, int k, int p, String s, String s1)
{
super(i);
maxStackSize = 1;
damage = l;
//This works in ModLoader?
accuracy = i1; //All this things will work Normaly?
clip = item;
rateOfFire = rof;
recoil = j;
reloadTime = k;
shootDelay = p;
type = s;
sound = s1;
}
This will work?:
public class ItemGun extends Item implements
{
private int damage;
private int accuracy;
private Item clip;
private int rateOfFire;
private int recoil;
private int reloadTime;
private int shootDelay;
public String type;
private String sound;
private static boolean mouseHeld;
private static boolean lastMouseHeld;
/**
*
* @param i the id of the gun
* @param l damage of bullte (in half hears)
* @param i1 accuracy of bullet (doesn't seem to be a factor, due to EntityBullet code
* @param item bullet (or might be changed to clip) that provides ammo
* @param rof rate of fire while the right mouse is being held down, doesn't do anything if rapid right click
* @param j recoil of gun
* @param k reload time of gun in ticks
* @param p time between shots
* @param type type of gun, can't seem to get this to do anything
* @param s sound the gun plays, again I can't seem to get this to do anything
*/
super(i);
maxStackSize = 1;
damage = 5;
accuracy = 11; //This works?
clip = 7;
rateOfFire = 10;
recoil = 10;
reloadTime = 12;
shootDelay = 10;
type = s;
sound = s1
Thank you and
sorry for my bad inglish
0
0
Sorry,but i don't know how i can make this...
0
Ok,
thank you the insitutions.
Your tutorials are awesomes and helped me so much...
0
And how i can make the spreading stop,after a time?
Sorry for bad inglish...
0
Sorry for bad inglish
0
You can make a tutorial of how to create a new explosion.class and customize then(algorithns,% of drops)
and how to use the new explosion.class in your TNT?
Sorry for bad inglish.
0
0
files:
mod_MoreTNTsAndExplosives:
EntityMoabPrimed:
RenderMoabExplosive:
MoabExplosive:
MoabCaller:
If you know the solution please help me,and sorry for bad inglish.
0
Thank you.
0
Your explosives tutorial works on 1.3.2
if not,
The entity part works?
0
0
mod_file:
MoabCallerfile:
Sorry for so many errors,i dont know so much about a bit Advanced Modding...
Sorry for bad inglish.