Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

I am trying to create a gun (I'm using forge for 1.8.9) and I'm running into some issues relating to firing methods. There are three different ways I have tried doing it:

1. Just firing bullets in the onItemRightClick method. Disadvantage: this method gets called MUCH less frequently than regular ticks, so guns fire very slowly

2. Firing bullets in the onUsingTick method. Disadvantage: since I'm modifying the NBT of  the item, this method has very odd behavior and causes the gun to never stop firing

3. Checking for key presses in the onUdpate method. Disadvantage: doesn't work on servers.

Is there some solution or better method I'm not seeing?

Before you say that I need to learn java, I will have you know that I have completed an advanced java course from johns hopkins university with an A- average.

Thanks, and have a nice day and a smiley :)

The fastest Minecraft can do anything is on a per-tick basis. Theoretically, someone might be able to right-click faster than once per tick and thus fire more bullets than any other method, but I haven't tested that. At worst, #onItemRightClick will be just as fast (or slow, depending on your perspective) as any of the tick methods.

 

You can, however, simulate faster than once-per-tick by spawning multiple bullets per click/tick with their position offset so that bullet 1 starts further away than bullet 2, e.g. by 1/2 to several block distances between each bullet. You could also give them slightly different trajectories to emulate 'spray' or not-quite-perfect accuracy (take a look at EntitySkeleton's ranged attack for an example).

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.