Would you happen to know why it doesnt spawn a "Bullet" in. Like the image doesnt show up. The damage and sounds and everything else is fine but not the pic for the bullet WHILE IN AIR ?
Would you make an updated version for 1.4.4 and explain it for new modders? For example, explain what line of code is responsible for what features, what each variable is for, ect.... That way people with less java experience can edit the properties of the gun and/or bullet without the risk of crashing the game.
Useful things to know:
How to increase or decrease effective range
Increase or decrease durability
How to make bullets infinite in creative mode
How to change fire rate
How to make the gun semi or fully automatic
How to just use bullets straight from the inventory instead of clips
basically every feature and how to change it, eliminate it, or add to it
The above would be a lot of work so if you're not up to it can you at least post an updated version and what needs to change for the updated version to work.
You haven't been replying very much so I see no reason why you would to me but I'll ask anyways.
Is it possible to add bullet spread? I know you must be busy, but if you could do this that would be great. Thanks!
Would you make an updated version for 1.4.4 and explain it for new modders? For example, explain what line of code is responsible for what features, what each variable is for, ect.... That way people with less java experience can edit the properties of the gun and/or bullet without the risk of crashing the game.
Useful things to know:
How to increase or decrease effective range
Increase or decrease durability
How to make bullets infinite in creative mode
How to change fire rate
How to make the gun semi or fully automatic
How to just use bullets straight from the inventory instead of clips
basically every feature and how to change it, eliminate it, or add to it
The above would be a lot of work so if you're not up to it can you at least post an updated version and what needs to change for the updated version to work.
If you look in the code, he has a lot of notes that explain each line of code.
Hey, I'm currently making a personal mod, a sword that shoots fireballs using a modified version of this code, however, I'm getting a ton of errors, I would greatly appreciate it if you could help.
package net.minecraft.src;
public class ItemFinisherSword extends Item
{
private int weaponDamage;
private int damage;
private int firetick;
private int firemax;
}
private final EnumFinisher toolMaterial;
public ItemFinisherSword(int par1, EnumFinisher par2EnumToolMaterialNameHere, int damage, int firedelay)
{
super(par1);
toolMaterial = par2EnumToolMaterialNameHere;
maxStackSize = 1;
setMaxDamage(par2EnumToolMaterialNameHere.getMaxUses());
weaponDamage = 4 + par2EnumToolMaterialNameHere.getDamageVsEntity();
this.damage = 26; //sets the damage value
firemax = 1; //sets the firemax value
firetick = firemax; //sets the firetick value equal to firemax (so you don't need to wait for the delay on the first shot)
setMaxStackSize(1); //sets the max stack size to one
}
/**
* Returns the strength of the stack against a given block. 1.0F base, (Quality+1)*2 if correct blocktype, 1.5F if
* sword
*/
public float getStrVsBlock(ItemStack par1ItemStack, Block par2Block)
{
return par2Block.blockID != Block.web.blockID ? 1.5F : 15F;
}
/**
* Current implementations of this method in child classes do not use the entry argument beside ev. They just raise
* the damage on the stack.
*/
public boolean hitEntity(ItemStack par1ItemStack, EntityLiving par2EntityLiving, EntityLiving par3EntityLiving)
{
par1ItemStack.damageItem(1, par3EntityLiving);
return true;
}
public boolean onBlockDestroyed(ItemStack par1ItemStack, int par2, int par3, int par4, int par5, EntityLiving par6EntityLiving)
{
par1ItemStack.damageItem(2, par6EntityLiving);
return true;
}
/**
* Returns the damage against a given entity.
*/
public int getDamageVsEntity(Entity par1Entity)
{
return weaponDamage;
}
/**
* Returns True is the item is renderer in full 3D when hold.
*/
public boolean isFull3D()
{
return true;
}
public ItemStack onFoodEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
return par1ItemStack;
}
/**
* How long it takes to use or consume an item
*/
public int getMaxItemUseDuration(ItemStack par1ItemStack)
{
return 72000;
}
/**
* Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
*/
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
if(firetick == firemax && firemax != 0){
//spawns the bullet
par2World.spawnEntityInWorld(new EntityFinisherShot(par2World, par3EntityPlayer, damage, 1));
//damages the gun
par1ItemStack.damageItem(1, par3EntityPlayer);
//resets the fire delay counter
firetick = 0;
}else{
//if the fire delay counter isn't done, then this is called, which increases the fire delay counter
++firetick;
}
//if firemax is 0 none of the above was called, so call this instead
if(firemax == 0){
par2World.spawnEntityInWorld(new EntityFinisherShot(par2World, par3EntityPlayer, damage, 1));
par1ItemStack.damageItem(1, par3EntityPlayer);
//already explained...
}
//just some housekeeping stuff
return par1ItemStack;
}
public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int i)
{
firetick = firemax;
}
/**
* Returns if the item (tool) can harvest results from the block type.
*/
public boolean canHarvestBlock(Block par1Block)
{
return par1Block.blockID == Block.web.blockID;
}
}
How can i make it so that my npc can hold the gun correctly and not like hes holding paper?
Nevermind all i had to do was add
public boolean isFull3D()
{
return true;
}
to the ItemGun class.
idk how to fix these issues. The first one is not possible in 1.2.5.
2 and 3 you would have to look at arrow code or something to figure that out.
And the sound, that is something I'm not very experienced with so you might want to ask someone else about it. It could be a problem with your ogg files not working.
@adlzman
I can't code your mod for you. Not even part of it. *shrugs*.
AND REMEMBER TO ANYBODY ELSE READING THIS: This code only works for 1.2.5, SINGLE PLAYER. This code is therefore incompatible with Minecraft 1.3.1 in a lot of ways. I also don't do much modding anymore, so unless you're not some guy who has less then 20 posts, and wants me to basically code the entire mod for you, I am not going to do that. If you have a decent amount of posts, and have a good idea of what your mod is going to be, then ask me and I will consider it. But I am not going to help you make a mod based off of some franchise when you have no real work done on how its going to work and look, etc. (not to be rude or anything, just saying that I would rather be "employed" by someone who knows what they're doing...)
Isn't it possible to make an "instanceof EntityPlayer" in the EntityBullet.class? Look in tghe EntityArrow class to find how they do it.
I'm working on a mod that adds the different weapons of Organization XIII from the kingdom hearts games and am curently stuck trying to code the arrow gun
Useful things to know:
How to increase or decrease effective range
Increase or decrease durability
How to make bullets infinite in creative mode
How to change fire rate
How to make the gun semi or fully automatic
How to just use bullets straight from the inventory instead of clips
basically every feature and how to change it, eliminate it, or add to it
The above would be a lot of work so if you're not up to it can you at least post an updated version and what needs to change for the updated version to work.
Is it possible to add bullet spread? I know you must be busy, but if you could do this that would be great. Thanks!
If you look in the code, he has a lot of notes that explain each line of code.
Thanks in advance.
Signature not found
How can i make it so that my npc can hold the gun correctly and not like hes holding paper?Nevermind all i had to do was add
public boolean isFull3D()
{
return true;
}
to the ItemGun class.
Isn't it possible to make an "instanceof EntityPlayer" in the EntityBullet.class? Look in tghe EntityArrow class to find how they do it.
Can someone help plz?
clip.shiftedIndex,
it red underlines the shiftedIntex part.
Someone help plz?