So, I'm not sure what I'm doing wrong. I've watched the spotlight vids and they're not doing anything different than I am that I'm aware. I have an iron scythe, and when I use the reaping attack to kill a mob, a sphere spawns where they died but I get no soul. Also, the Harbinger's spawn rate is ridiculous. Anywhere near water and they're 20+ of them in one little area.
Alright, so long ago and far away, I was able to take the ItemBow, ItemArrow, EntityArrow, and RenderArrow, and create a simple handgun that shot.. basically a high velocity invisible arrow (which was called Bullet).
But now, there's a bunch of stuff that's been added now because of enchantments and other things. AND, there's no more .java specifically for the arrow, it's now contained in the item.java from what I can tell.
THEN there's the entity arrow. I've been away from java for a while, and it all looks like rocket science now.
I was hoping I could get some tips on constructing my own handgun and ammunition from the above classes I've mentioned.
I also happened to add recoil to my handgun before, and I plan on making a more intuitive way the recoil is created so the gun would feel very CounterStrike-esque. And I plan to implement this into other guns once I've made the handgun.
Anyway, does anyone have any tips on deciphering the 1.2.3 code for the above classes to help me build my own gun mod? I know there's plenty out there, but they are coded to feel the way I like. SDK's is the closest, but it adds way too many crafting items and more guns than I plan to use for the project I'm planning.
Here's ItemBow:
package net.minecraft.src;
import java.util.Random;
public class ItemBow extends Item
{
public ItemBow(int par1)
{
super(par1);
maxStackSize = 1;
setMaxDamage(384);
}
/**
* called when the player releases the use item button. Args: itemstack, world, entityplayer, itemInUseCount
*/
public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4)
{
boolean flag = par3EntityPlayer.capabilities.depleteBuckets || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, par1ItemStack) > 0;
if (flag || par3EntityPlayer.inventory.hasItem(Item.arrow.shiftedIndex))
{
int i = getMaxItemUseDuration(par1ItemStack) - par4;
float f = (float)i / 20F;
f = (f * f + f * 2.0F) / 3F;
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.arrowCritical = true;
}
int j = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, par1ItemStack);
if (j > 0)
{
entityarrow.setDamage(entityarrow.getDamage() + (double)j * 0.5D + 0.5D);
}
int k = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, par1ItemStack);
if (k > 0)
{
entityarrow.func_46023_b(k);
}
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)
{
par3EntityPlayer.inventory.consumeInventoryItem(Item.arrow.shiftedIndex);
}
else
{
entityarrow.doesArrowBelongToPlayer = false;
}
if (!par2World.isRemote)
{
par2World.spawnEntityInWorld(entityarrow);
}
}
}
public ItemStack onFoodEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
return par1ItemStack;
}
public int getMaxItemUseDuration(ItemStack par1ItemStack)
{
return 0x11940;
}
public EnumAction getItemUseAction(ItemStack par1ItemStack)
{
return EnumAction.bow;
}
/**
* 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 (par3EntityPlayer.capabilities.depleteBuckets || par3EntityPlayer.inventory.hasItem(Item.arrow.shiftedIndex))
{
par3EntityPlayer.setItemInUse(par1ItemStack, getMaxItemUseDuration(par1ItemStack));
}
return par1ItemStack;
}
/**
* Return the enchantability factor of the item, most of the time is based on material.
*/
public int getItemEnchantability()
{
return 1;
}
}
And here's my gutted version (No enchantments, no criticals)
package net.minecraft.src;
public class ItemGun extends Item
{
protected ItemGun(int i)
{
super(i);
maxStackSize = 1;
}
public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4)
{
if (par3EntityPlayer.inventory.hasItem(Item.arrow.shiftedIndex)) //Replace with bullet when made
{
EntityArrow entityarrow = new EntityArrow(par2World, par3EntityPlayer, 2.0F); // Change to bullet
entityarrow.setDamage(entityarrow.getDamage());
par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + 0.5F); //set to explosion
par3EntityPlayer.inventory.consumeInventoryItem(Item.arrow.shiftedIndex); //change to bullet
if (!par2World.isRemote)
{
par2World.spawnEntityInWorld(entityarrow);
}
}
}
}
Alright, so long ago and far away, I was able to take the ItemBow, ItemArrow, EntityArrow, and RenderArrow, and create a simple handgun that shot.. basically a high velocity invisible arrow (which was called Bullet).
But now, there's a bunch of stuff that's been added now because of enchantments and other things. AND, there's no more .java specifically for the arrow, it's now contained in the item.java from what I can tell.
THEN there's the entity arrow. I've been away from java for a while, and it all looks like rocket science now.
I was hoping I could get some tips on constructing my own handgun and ammunition from the above classes I've mentioned.
I also happened to add recoil to my handgun before, and I plan on making a more intuitive way the recoil is created so the gun would feel very CounterStrike-esque. And I plan to implement this into other guns once I've made the handgun.
Anyway, does anyone have any tips on deciphering the 1.2.3 code for the above classes to help me build my own gun mod? I know there's plenty out there, but they are coded to feel the way I like. SDK's is the closest, but it adds way too many crafting items and more guns than I plan to use for the project I'm planning.
Here's ItemBow:
package net.minecraft.src;
import java.util.Random;
public class ItemBow extends Item
{
public ItemBow(int par1)
{
super(par1);
maxStackSize = 1;
setMaxDamage(384);
}
/**
* called when the player releases the use item button. Args: itemstack, world, entityplayer, itemInUseCount
*/
public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4)
{
boolean flag = par3EntityPlayer.capabilities.depleteBuckets || EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, par1ItemStack) > 0;
if (flag || par3EntityPlayer.inventory.hasItem(Item.arrow.shiftedIndex))
{
int i = getMaxItemUseDuration(par1ItemStack) - par4;
float f = (float)i / 20F;
f = (f * f + f * 2.0F) / 3F;
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.arrowCritical = true;
}
int j = EnchantmentHelper.getEnchantmentLevel(Enchantment.power.effectId, par1ItemStack);
if (j > 0)
{
entityarrow.setDamage(entityarrow.getDamage() + (double)j * 0.5D + 0.5D);
}
int k = EnchantmentHelper.getEnchantmentLevel(Enchantment.punch.effectId, par1ItemStack);
if (k > 0)
{
entityarrow.func_46023_b(k);
}
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)
{
par3EntityPlayer.inventory.consumeInventoryItem(Item.arrow.shiftedIndex);
}
else
{
entityarrow.doesArrowBelongToPlayer = false;
}
if (!par2World.isRemote)
{
par2World.spawnEntityInWorld(entityarrow);
}
}
}
public ItemStack onFoodEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
{
return par1ItemStack;
}
public int getMaxItemUseDuration(ItemStack par1ItemStack)
{
return 0x11940;
}
public EnumAction getItemUseAction(ItemStack par1ItemStack)
{
return EnumAction.bow;
}
/**
* 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 (par3EntityPlayer.capabilities.depleteBuckets || par3EntityPlayer.inventory.hasItem(Item.arrow.shiftedIndex))
{
par3EntityPlayer.setItemInUse(par1ItemStack, getMaxItemUseDuration(par1ItemStack));
}
return par1ItemStack;
}
/**
* Return the enchantability factor of the item, most of the time is based on material.
*/
public int getItemEnchantability()
{
return 1;
}
}
And here's my gutted version (No enchantments, no criticals)
package net.minecraft.src;
public class ItemGun extends Item
{
protected ItemGun(int i)
{
super(i);
maxStackSize = 1;
}
public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4)
{
if (par3EntityPlayer.inventory.hasItem(Item.arrow.shiftedIndex)) //Replace with bullet when made
{
EntityArrow entityarrow = new EntityArrow(par2World, par3EntityPlayer, 2.0F); // Change to bullet
entityarrow.setDamage(entityarrow.getDamage());
par2World.playSoundAtEntity(par3EntityPlayer, "random.bow", 1.0F, 1.0F / (itemRand.nextFloat() * 0.4F + 1.2F) + 0.5F); //set to explosion
par3EntityPlayer.inventory.consumeInventoryItem(Item.arrow.shiftedIndex); //change to bullet
if (!par2World.isRemote)
{
par2World.spawnEntityInWorld(entityarrow);
}
}
}
}
I'm thinking for a mod that would be compatible with a certain map and would be use like a campaign in any other game, for instance, a fps game, it would add a certain number of guns, and mobs.
Take, for instance, a Crysis 2 "mod" idea kinda thing that this could be used for, there's like 1-2 or more of each category of gun and there's an rpg or so and grenades, then you have enemies that are humans, then the basic alien, the upgraded alien, and then the "heavy" alien that takes a few explosives to kill. Then there's the big robot thing that takes even more explosives.
And the mod wouldn't really give you any crafting recipes to craft the things, because then a map designer would create a map and choose what weapons the player gets in a chest and where enemies get placed.
Maybe it's dumb, or done before, or maybe over done, but I haven't seen a mod intended to be used into a campaign sort of setting... like this.
Maybe I didn't explain it the best, but if someone who gets it could explain it better, and maybe think of a better topic title, go ahead and give me an idea and maybe tell me what you think?
0
Alright, thanks, I didn't see anything in the front mentioning that, nor in the videos.
0
Edit:
Is there any way to reduce the spawn on the friggin harbingers? 20+ over powered bastards in a 20x20 square area is annoying.
0
0
I hope it stays that way.
0
I'm having this same problem! However, I was using them for a custom map ><
And it's more like the entire room is lit up, not just one corner, for me, because the whole room is made of them.
0
But now, there's a bunch of stuff that's been added now because of enchantments and other things. AND, there's no more .java specifically for the arrow, it's now contained in the item.java from what I can tell.
THEN there's the entity arrow. I've been away from java for a while, and it all looks like rocket science now.
I was hoping I could get some tips on constructing my own handgun and ammunition from the above classes I've mentioned.
I also happened to add recoil to my handgun before, and I plan on making a more intuitive way the recoil is created so the gun would feel very CounterStrike-esque. And I plan to implement this into other guns once I've made the handgun.
Anyway, does anyone have any tips on deciphering the 1.2.3 code for the above classes to help me build my own gun mod? I know there's plenty out there, but they are coded to feel the way I like. SDK's is the closest, but it adds way too many crafting items and more guns than I plan to use for the project I'm planning.
Here's ItemBow:
0
But now, there's a bunch of stuff that's been added now because of enchantments and other things. AND, there's no more .java specifically for the arrow, it's now contained in the item.java from what I can tell.
THEN there's the entity arrow. I've been away from java for a while, and it all looks like rocket science now.
I was hoping I could get some tips on constructing my own handgun and ammunition from the above classes I've mentioned.
I also happened to add recoil to my handgun before, and I plan on making a more intuitive way the recoil is created so the gun would feel very CounterStrike-esque. And I plan to implement this into other guns once I've made the handgun.
Anyway, does anyone have any tips on deciphering the 1.2.3 code for the above classes to help me build my own gun mod? I know there's plenty out there, but they are coded to feel the way I like. SDK's is the closest, but it adds way too many crafting items and more guns than I plan to use for the project I'm planning.
Here's ItemBow:
0
I saw that. They aren't Zombies in this mod though. It's different custom mobs.
0
Take, for instance, a Crysis 2 "mod" idea kinda thing that this could be used for, there's like 1-2 or more of each category of gun and there's an rpg or so and grenades, then you have enemies that are humans, then the basic alien, the upgraded alien, and then the "heavy" alien that takes a few explosives to kill. Then there's the big robot thing that takes even more explosives.
And the mod wouldn't really give you any crafting recipes to craft the things, because then a map designer would create a map and choose what weapons the player gets in a chest and where enemies get placed.
Maybe it's dumb, or done before, or maybe over done, but I haven't seen a mod intended to be used into a campaign sort of setting... like this.
Maybe I didn't explain it the best, but if someone who gets it could explain it better, and maybe think of a better topic title, go ahead and give me an idea and maybe tell me what you think?
Minecraft is virtually a completely open, sandbox game where we can do what we want with it. And this is something I'd love to play. Especially if someone made something like this to be used on this map http://www.minecraftforum.net/topic/155089-surv-zombie-apocalypse-final-demo-released/
That would be awesome.
0
0
0
Message me if you'd be up for it. I'd be able to do a dual com with you or box you or whatever!
0
0
0