Jump to content

HappleAcks

Members
  • Posts

    124
  • Joined

  • Last visited

Posts posted by HappleAcks

  1. Just add a variable in your item class called tickssincefired, and every tick increase it by one, and if it = 4 then fire a bullet and set it to 0. This is basic logic. -_-

    The reason you don't do that is because that variable will be the same for every single instance of the Item, making it incompatible in multiplayer for sure, and possibly in single player as well if you have two or more of the item in question.

     

    @OP Your code is close, but when you right click, you forgot to set the time at which it was fired, meaning that every click will allow it to fire as world time > 0 is always true ;)

     

    Add this to your right-click method after determining that you should fire a shot:

    stack.getTagCompound().setLong("lastShotTime", world.getWorldTime() + delay);
    // where 'delay' is an integer equal to the number of ticks you want to delay between shots
    

     

    That should now prevent you from spamming right click to fire quickly, while still allowing you to hold right-click and fire continuously while the item is in use.

    Worked, thank you so much!

  2.  

     

    int tickssinceshot = 0;

     

    if(tickssinceshot = 0){

     

    Do crap

    Tickssinceshot = 4;

    }

    Else {

    Tickssinceshot--;

    }

     

     

     

    Problem solved.

    Reversing it literally changes nothing. The exact same problem occurs, except it counts down. It starts at 4 (or X) and then counts down to 0 WHEN USING IT (because it's in the UsingItem method, which only is called when it's in use). This means that when you are not using it, the countdown stops. That's why I'm using the method CoolAlias provided, because it doesn't do that and will work at all times, except when spam right clicking (however he provided a solution to this, but I needed clarification for slowing down the speed, as I mentioned earlier).

  3. Why are you trying to store ticks in use as the max use duration? After your constructor, put

    int tickssincefired = 0;

     

    Then in the onUsingItem method put

     

    if (tickssincefired = 4){

    //Fire the bullet

    }else {

    tickssincefired++;

    }

     

    I don't know why you're trying to store it somewhere, it doesn't need to persist across relog or anything like that, and that variable won't get reset any time other then that.

    Earlier in the thread I mentioned this method is ineffective because then you can't just right click and shoot after X ticks, it'll require you hold it for X ticks first, since it only counts ticks up when in use, not while not in use. This is why the other method is used, which also works. The only thing I'm wondering how I do is change the speed, and if I know that it works 100%.

  4. Just add a variable in your item class called tickssincefired, and every tick increase it by one, and if it = 4 then fire a bullet and set it to 0. This is basic logic. -_-

    That's literally what this whole thread has been about how to go about doing. "-.-"

     

    CoolAlias has gotten me really close, but I don't know how to slow it down with his method.

     

     

  5. I'm not sure I can make it much clearer than that... you need both methods - onUsingTick to fire repeatedly while the item is in use, and onItemRightClick to prevent spamming right click from being faster than your onUsingTick rate of fire. And please don't extend ItemSword for a gun item - that just doesn't make any sense.

    My only problem is I don't know how to slow down the onItemRightClick (the speed it takes is a string?).

    current code:

     

     

    public class Sniper extends ItemSword{

     

      public Sniper (int i, ToolMaterial p_i45356_1_){

    super(p_i45356_1_);

    setFull3D();

      this.setCreativeTab(CreativeTabs.tabCombat);

    }

     

      @Override

      public void onUsingTick(ItemStack par1ItemStack, EntityPlayer player, int count) {

      // count starts at the max duration and counts down

      int ticksInUse = getMaxItemUseDuration(par1ItemStack) - count;

     

      // this will fire every 2 ticks; change or remove to suit your needs

      if (ticksInUse % 14 == 0) {

        if(player.capabilities.isCreativeMode||player.inventory.consumeInventoryItem(darkMod.bullet))

          {

        player.worldObj.playSoundAtEntity(player, "darkmod:Sniper", 1.0F, 1.0F);

            if (!player.worldObj.isRemote)

            {

            player.worldObj.spawnEntityInWorld(new EntityBullet(player.worldObj, player, 7.0F));

            }

          }

      }

      }

     

      @Override

    public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {

     

    // verify tag compound:

    if (!stack.hasTagCompound()) {

    // didn't have one, so make a new one:

    stack.setTagCompound(new NBTTagCompound());

    }

     

    // now you can check the world time vs. the time stored in the tag

    // if no time is stored, that's okay - it will return zero

    if (world.getWorldTime() > stack.getTagCompound().getLong("lastShotTime")) {

    if(player.capabilities.isCreativeMode||player.inventory.consumeInventoryItem(darkMod.bullet))

          {

        player.worldObj.playSoundAtEntity(player, "darkmod:Sniper", 1.0F, 1.0F);

            if (!player.worldObj.isRemote)

            {

            player.worldObj.spawnEntityInWorld(new EntityBullet(player.worldObj, player, 9.0F));

            }

          }

    // set item in use

    } else {

    // 'click', you can't fire yet!

    }

     

      return stack;

      }

     

     

    Does anybody know about how to slow this down, after implementation it still fires at a very rapid speed when tapping (probably because I don't know how to slow down the speed from onItemRightClick). I should also mention that the onItemRightClick has also sped up the holding-down speed (once again, probably because it is too fast).  Also, I've tried adding a large number after the stack.getTagCompound().getLong("lastShotTime") but it doesn't seem to affect anything.

  6. I'm not sure I can make it much clearer than that... you need both methods - onUsingTick to fire repeatedly while the item is in use, and onItemRightClick to prevent spamming right click from being faster than your onUsingTick rate of fire. And please don't extend ItemSword for a gun item - that just doesn't make any sense.

    It extends item sword because I made it so you can add melee attachments to the guns.

     

    As for implementation, I do have both methods there, and I get that one is for holding right clicking (onUsingTick) and the onItemRightClick is for the rapid tapping.

     

    My only problem is I don't know how to slow down the onItemRightClick (the speed it takes is a string?).

     

     

    current code:

     

     

    public class Sniper extends ItemSword{

     

      public Sniper (int i, ToolMaterial p_i45356_1_){

    super(p_i45356_1_);

    setFull3D();

      this.setCreativeTab(CreativeTabs.tabCombat);

    }

     

      @Override

      public void onUsingTick(ItemStack par1ItemStack, EntityPlayer player, int count) {

      // count starts at the max duration and counts down

      int ticksInUse = getMaxItemUseDuration(par1ItemStack) - count;

     

      // this will fire every 2 ticks; change or remove to suit your needs

      if (ticksInUse % 14 == 0) {

        if(player.capabilities.isCreativeMode||player.inventory.consumeInventoryItem(darkMod.bullet))

          {

        player.worldObj.playSoundAtEntity(player, "darkmod:Sniper", 1.0F, 1.0F);

            if (!player.worldObj.isRemote)

            {

            player.worldObj.spawnEntityInWorld(new EntityBullet(player.worldObj, player, 7.0F));

            }

          }

      }

      }

     

      @Override

    public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {

     

    // verify tag compound:

    if (!stack.hasTagCompound()) {

    // didn't have one, so make a new one:

    stack.setTagCompound(new NBTTagCompound());

    }

     

    // now you can check the world time vs. the time stored in the tag

    // if no time is stored, that's okay - it will return zero

    if (world.getWorldTime() > stack.getTagCompound().getLong("lastShotTime")) {

    if(player.capabilities.isCreativeMode||player.inventory.consumeInventoryItem(darkMod.bullet))

          {

        player.worldObj.playSoundAtEntity(player, "darkmod:Sniper", 1.0F, 1.0F);

            if (!player.worldObj.isRemote)

            {

            player.worldObj.spawnEntityInWorld(new EntityBullet(player.worldObj, player, 9.0F));

            }

          }

    // set item in use

    } else {

    // 'click', you can't fire yet!

    }

     

      return stack;

      }

     

     

     

     

     

     

  7. Would this be instead of my onUsingTick method of changing the fire rate, so I'll completely remove the old method and use the new one? Or should this be merged into it (in this case I don't really know where to go with it).

    No, it is in addition to the onUsingTick method.

     

    Then in the case I'm a bit puzzled. I know I'm sound really cruddy here, but I don't know how to go about merging these methods.

  8. I've never worked with NBT before, so I don't really know how to go about implementing this.

    Here is a good introduction.

     

    You will need to override the onItemRightClick method

     

    Would this be instead of my onUsingTick method of changing the fire rate, so I'll completely remove the old method and use the new one? Or should this be merged into it (in this case I don't really know where to go with it).

  9. What you could do is use the damage bar or item metadata as a reload counter, for example if you want to have a 40 second reload you could set the meta data to 40 and then subtract 1 every tick. Example:

    public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5)
    {
    	par1ItemStack.getItemDamageForDisplay();
    int i=par1ItemStack.getItemDamage();
    	if(i>0)
    	{
    		par1ItemStack.setItemDamage(i-1);
    	}
    }

    And then in your firing code check if par1ItemStack.getItemDamageForDisplay()=0 and then do par1ItemStack.setItemDamage('relaodtime");

    This method turned out to be really buggy. The gun will keep firing as soon as you click once and never stop, as well as it looks weird.

     

    Hi

     

    Sounds like you just want to ignore a click if it's too soon after a previous one.  You need to be able to tell when the gun was last fired.

     

    If you have a global tick counter in your code somewhere, you could refer to that.

     

    For example

     

    fireMyGun() {
      lastTickFired =  MyMod.getGlobalTickCount();
    }
    
    void tryToFireGun() {
    int tickNow = MyMod.getGlobalTickCount();
    int ticksSinceLastFired = tickNow - lastTickFired;
    assert ticksSinceLastFired >= 0;
    
    if (ticksSinceLastFire > MINIMUM_FIRING_DELAY) {
      fireMyGun()
    }
    

     

    -TGG

    I'm not quite sure how to implement this along with my existing code.

     

    @OP The best way, in my opinion, is to store the counter / last-time-shot directly in your item's NBT.

     

    Check your NBT-based right-click cooldown / shot-time before allowing the player to set the item in use upon right click, and be sure to decrement the cooldown in your item's onUpdate method if that's the route you choose. Using world time would be easier in this case: upon setting the item in use, set a long in the NBT for current world time + number of ticks you want to stall, and you don't have to worry about updating anything, as the world time does the counting for you.

     

    You could also do what TGG suggested, but I personally prefer to keep fields and methods compartmentalized within the object that requires them - for one, it makes it much easier for me to debug, since all the code is in one place.

    I've never worked with NBT before, so I don't really know how to go about implementing this.

     

    My current code:

     

     

    public class SniperRifle extends ItemSword{

     

     

      public SniperRifle(int i, ToolMaterial p_i45356_1_){

    super(p_i45356_1_);

    setFull3D();

        this.setCreativeTab(CreativeTabs.tabCombat);

      }

     

      @Override

      public void onUsingTick(ItemStack par1ItemStack, EntityPlayer player, int count) {

      // count starts at the max duration and counts down

      int ticksInUse = getMaxItemUseDuration(par1ItemStack) - count;

     

      // this will fire every 20 ticks; change or remove to suit your needs

      if (ticksInUse % 20 == 0) {

        if(player.capabilities.isCreativeMode||player.inventory.consumeInventoryItem(darkMod.Bullet))

          {

        player.worldObj.playSoundAtEntity(player, "darkmod:Rifle", 1.0F, 1.0F);

            if (!player.worldObj.isRemote)

            {

            player.worldObj.spawnEntityInWorld(new EntityBullet(player.worldObj, player, 12.0F));

            }

          }

      }

      }

     

      @Override

      public EnumAction getItemUseAction(ItemStack par1ItemStack)

      {

          return EnumAction.none;

      }

    }

     

     

     

  10. The held position is caused because you set your EnumAction to .block; change it to .none and your gun position will not change.

    I never touched touched that though.

     

    My code:

     

     

    public class Rifle extends ItemSword{

     

      public Rifle(int i, ToolMaterial p_i45356_1_){

    super(p_i45356_1_);

    setFull3D();

        this.setCreativeTab(CreativeTabs.tabCombat);

      }

     

      @Override

      public void onUsingTick(ItemStack par1ItemStack, EntityPlayer player, int count) {

      // count starts at the max duration and counts down

      int ticksInUse = getMaxItemUseDuration(par1ItemStack) - count;

     

      // this will fire every 2 ticks; change or remove to suit your needs

      if (ticksInUse % 2 == 0) {

        if(player.capabilities.isCreativeMode||player.inventory.consumeInventoryItem(darkMod.bullet))

          {

        player.worldObj.playSoundAtEntity(player, "darkMod:Rifle", 1.0F, 1.0F);

            if (!player.worldObj.isRemote)

            {

            player.worldObj.spawnEntityInWorld(new EntityBullet(player.worldObj, player, 9.0F));

            }

          }

      }

      }

      }

     

     

  11. To get the world just use player.worldObj

    Removing the override it breaks it, you should work around it instead of remove it (for example, just use something else that runs every tick and already gives you the world object to check if the player is right clicking with your item and spawn the entity.

    This worked! - ALMOST, the only problem is that now the gun is still held on a funny angle when shooting. Is there a way to make it so it doesn't visually change when shooting? It didn't with my old method, but this new method allows me to make it shoot faster.

  12. Well I tried implementing according to the comments left, and when I right click while holding the rifle it just holds it on a weird angle and doesn't fire anything.

     

    The code - @Override had to be removed to allow me to use the World parameter to create the entity.

    Anytime you elect to remove an @Override annotation, you break your code. Seriously, is this not posted multiple times on these boards?

    If you have to remove that, it means you are no longer overriding any superclass method, and your method is likely never to be called or used at all. The superclass method will still be called in every case that you don't specifically call your method on an instance of your object.

     

    Overriding methods is basic java. If you do not understand how to override a method, learn java first. The IDE does not teach java and it will only offer to remove syntax errors, it cannot "fix" your code or even figure out what you want to do.

     

     

    All methods in java have a signature. Multiple methods can have the exact same names because the parameter (argument) types and number of them determine which is the correct method.

    If you override a method and then change any parameter type or add or remove parameters, you no longer override that method. You just created a completely independent method with the same name.

     

     

    ^^ Exactly what Sequituri said.

     

    The method I posted is the 1.7.2 version; since I have not seen anywhere that you specify for which version you are coding, I assume you are coding for 1.7.2. If that's not the case, you should either say so in your topic title or first post, and learn to use your IDE and Java to find what the method might be called in whatever version you happen to be using.

    I am using 1.7.2. As I mentioned though, to keep the Override I must retain the original parameters which don't include the World, but I don't know how to spawn an entity without the world parameter. When I just remove that parameter and above add a declaration (public World par2World;) then the game crashes when I fire the weapon.

     

    Crash report:

     

     

    Reported exception thrown!

    net.minecraft.util.ReportedException: Ticking entity

    at net.minecraft.world.World.updateEntities(World.java:2111) ~[World.class:?]

    at net.minecraft.client.Minecraft.runTick(Minecraft.java:2104) ~[Minecraft.class:?]

    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1036) ~[Minecraft.class:?]

    at net.minecraft.client.Minecraft.run(Minecraft.java:951) [Minecraft.class:?]

    at net.minecraft.client.main.Main.main(Main.java:112) [Main.class:?]

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_51]

    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_51]

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_51]

    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_51]

    at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?]

    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]

    Caused by: java.lang.NullPointerException

    at com.darkMod.item.weapon.Rifle.onUsingTick(Rifle.java:41) ~[Rifle.class:?]

    at net.minecraft.entity.player.EntityPlayer.onUpdate(EntityPlayer.java:306) ~[EntityPlayer.class:?]

    at net.minecraft.client.entity.EntityClientPlayerMP.onUpdate(EntityClientPlayerMP.java:106) ~[EntityClientPlayerMP.class:?]

    at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2286) ~[World.class:?]

    at net.minecraft.world.World.updateEntity(World.java:2246) ~[World.class:?]

    at net.minecraft.world.World.updateEntities(World.java:2096) ~[World.class:?]

    ... 10 more

     

    Description: Ticking entity

     

    java.lang.NullPointerException: Ticking entity

    at com.darkMod.item.weapon.Rifle.onUsingTick(Rifle.java:41)

    at net.minecraft.entity.player.EntityPlayer.onUpdate(EntityPlayer.java:306)

    at net.minecraft.client.entity.EntityClientPlayerMP.onUpdate(EntityClientPlayerMP.java:106)

    at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2286)

    at net.minecraft.world.World.updateEntity(World.java:2246)

    at net.minecraft.world.World.updateEntities(World.java:2096)

    at net.minecraft.client.Minecraft.runTick(Minecraft.java:2104)

    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1036)

    at net.minecraft.client.Minecraft.run(Minecraft.java:951)

    at net.minecraft.client.main.Main.main(Main.java:112)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

    at java.lang.reflect.Method.invoke(Unknown Source)

    at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)

    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

     

     

     

  13. This confused me a little bit when it came to the implementation, since I haven't worked with ticks much. Could you clarify how to implement this code?

    That was the entire implementation, aside from consuming the bullet and spawning the entity; what more do you need? It's a method in the Item class, just put it in your rifle class and add what you need. 20 ticks is roughly one second.

    Well I tried implementing according to the comments left, and when I right click while holding the rifle it just holds it on a weird angle and doesn't fire anything.

     

    The code - @Override had to be removed to allow me to use the World parameter to create the entity.

     

     

      public void onUsingTick(ItemStack par1ItemStack, EntityPlayer player, World par2World, int count) {

      // count starts at the max duration and counts down

      int ticksInUse = getMaxItemUseDuration(par1ItemStack) - count;

     

      // this will fire every 2 ticks; change or remove to suit your needs

      if (ticksInUse % 2 == 0) {

      if(player.capabilities.isCreativeMode||player.inventory.consumeInventoryItem(darkMod.bullet))

      {

      par2World.playSoundAtEntity(player, "darkMod:Rifle", 1.0F, 1.0F);

        if (!par2World.isRemote)

        {

          par2World.spawnEntityInWorld(new EntityBullet(par2World, player, 9.0F));

        }

      }

      // consume bullet and spawn projectile on server

      }

     

     

  14. Note that you cannot check mouse and keyboard states on the server, and they are thus not suitable for spawning entities without sending packets, since entities must spawn on the server.

     

    Besides, the using item method already IS a tick handler, being called every single tick while the item is in use, and should be the preferred method if you want a fast rate of fire (20 bullets per second, about). On right click, you need to set your item in use and make sure to give it a max item use duration, then in the update tick spawn an entity every tick, every other tick, or however many ticks you want.

     

    @Override
    public void onUsingTick(ItemStack stack, EntityPlayer player, int count) {
    // count starts at the max duration and counts down
    int ticksInUse = getMaxItemUseDuration(stack) - count;
    
    // this will fire every 2 ticks; change or remove to suit your needs
    if (ticksInUse % 2 == 0) {
    // consume bullet and spawn projectile on server
    }
    }
    

    If you want faster than one bullet per tick, you can use a render tick handler/event and send a packet to the server each render tick to consume and spawn the bullet, but I think 20 per second should be plenty fast.

    This confused me a little bit when it came to the implementation, since I haven't worked with ticks much. Could you clarify how to implement this code?

    Still waiting on this, since I don't really know how to implement it along with my current weapon code.

  15. Note that you cannot check mouse and keyboard states on the server, and they are thus not suitable for spawning entities without sending packets, since entities must spawn on the server.

     

    Besides, the using item method already IS a tick handler, being called every single tick while the item is in use, and should be the preferred method if you want a fast rate of fire (20 bullets per second, about). On right click, you need to set your item in use and make sure to give it a max item use duration, then in the update tick spawn an entity every tick, every other tick, or however many ticks you want.

     

    @Override
    public void onUsingTick(ItemStack stack, EntityPlayer player, int count) {
    // count starts at the max duration and counts down
    int ticksInUse = getMaxItemUseDuration(stack) - count;
    
    // this will fire every 2 ticks; change or remove to suit your needs
    if (ticksInUse % 2 == 0) {
    // consume bullet and spawn projectile on server
    }
    }
    

    If you want faster than one bullet per tick, you can use a render tick handler/event and send a packet to the server each render tick to consume and spawn the bullet, but I think 20 per second should be plenty fast.

    This confused me a little bit when it came to the implementation, since I haven't worked with ticks much. Could you clarify how to implement this code?

  16. Yep, if post your item class here I might be able to give you a better solution

     

    An example of a weapon firing default speed that I want to make fire faster:

     

     

     

    public class Rifle extends ItemSword{

     

      public Rifle(int i, ToolMaterial p_i45356_1_){

    super(p_i45356_1_);

    setFull3D();

        this.setCreativeTab(CreativeTabs.tabCombat);

      }

     

      public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World,EntityPlayer par3EntityPlayer) {

      if(par3EntityPlayer.capabilities.isCreativeMode||par3EntityPlayer.inventory.consumeInventoryItem(darkMod.bullet))

      {

        par2World.playSoundAtEntity(par3EntityPlayer, "darkmod:gun", 1.0F, 1.0F);

        if (!par2World.isRemote)

        {

          par2World.spawnEntityInWorld(new EntityBullet(par2World, par3EntityPlayer, 15.0F));

        }

      }

      return par1ItemStack;

      }

     

     

    }

     

     

     

    An example of my method for making a weapon fire slower:

     

     

    public class Sniper extends ItemSword{

    private int firetick;

    private int firemax;

     

      public Sniper(int i, ToolMaterial p_i45356_1_){

    super(p_i45356_1_);

    setFull3D();

        this.firemax = 4;

        this.firetick = this.firemax;

        this.setCreativeTab(CreativeTabs.tabCombat);

      }

     

      public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World,EntityPlayer par3EntityPlayer) {

      if(!par2World.isRemote) {

    if (this.firetick == this.firemax && this.firemax != 0) {

    if(par3EntityPlayer.capabilities.isCreativeMode||par3EntityPlayer.inventory.consumeInventoryItem(darkMod.bullet)){

    par2World.playSoundAtEntity(par3EntityPlayer, "darkMod:Sniper", 1.0F, 1.0F);

    par2World.spawnEntityInWorld(new EntityBullet(par2World, par3EntityPlayer, 10.0F));

    }

     

    this.firetick = 0;

    } else {

    ++this.firetick;

    }

    if (this.firemax == 0) {

                            if(par3EntityPlayer.capabilities.isCreativeMode||par3EntityPlayer.inventory.consumeInventoryItem(darkMod.bullet)){

    par2World.playSoundAtEntity(par3EntityPlayer, "darkMod:Sniper", 1.0F, 1.0F);

    par2World.spawnEntityInWorld(new EntityBullet(par2World, par3EntityPlayer, 10.0F));

    }

    }

       

      }

      return par1ItemStack;

      }

     

      @Override

    public void onPlayerStoppedUsing(ItemStack var1, World var2, EntityPlayer var3, int var4) {

    this.firetick = this.firemax;

    }

     

     

     

     

  17. 80 times a second? What do you need that kind of speed for... I think I have a workaround solution though.... Say you want to make it fire every half tick, you could make it spawn 2 nearly identical projectiles every tick, one of which would have special code in it's onupdate meathod to move it forward half the difference it would travel in a tick as soon as it spawns, staggering them. This technique could be modified for any RoF you need.

    Oh, is that how long a tick is? My current fire rate is like 1 shot every half second.

  18. Is it just a singular item that's shooting it, or a consumable? If it's a singluar item then if the shooting is happening in the items onUsingTick method I think that's the fastest it can get, seeing it's called every tick and you can't really do anything between ticks... (Could be wrong though)

    It's a singular item that is consuming a different item. Also, it currently seems to be once/tick, but I've seen mods where mobs can shoot like an arrow every 1/4 of a tick just at ridiculous rates so I was wondering if that is possible to transfer to a weapon.

  19. Hi

     

    Do you mean - the bullets fire more frequently, or the bullets travel faster?

     

    -TGG

    More frequently, I already have them moving fast/not affected by gravity. :) 

     

    - I do have a problem with slower firing weapons though, where you need to hold down the right mouse button for a second before it fires. I think this is because I set it so that it reduces the cool-down on right click, but not while just sitting there.

×
×
  • Create New...

Important Information

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