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.

[1.8] custom Entity how to make to set an item in use for at least 30 ticks ?

Featured Replies

Posted

God days

[broken english advertisment]

 

well im working again in the entityes for mi mod and i want to given the hability to use mi custom fireguns or bows,

http://www.curse.com/mc-mods/minecraft/228033-mercenarymod

 

but to make mi guns/bows shoot you must held rigth click and its shoots frm the item.class  onUsingTick() method 

 

i alredy learn how to make the custom entity to swing an item, is realy easy just to add an entity.swingItem(); inside the public void attackEntityWithRangedAttack(EntityLivingBase p_82196_1_, float p_82196_2_){} method,  and i been using that to trigger the gun shoot

 

but idont have idea how to make it actually use the item as a rigth click, i know is posible becose the entiies from the little maid works that way 

 

 

here is an example of mi working the trouble here is  i  have to make three diferent p90 guns

* the first is the version for the player that shoot while i held rigth click during  the onUsingTick() method from the item class,

* the second is for mi mob in this case has a yunno gasai skin this p90 shoots on onEntitySwing().

* and the last is the version to use whith little maid mod, this one shoots onPlayerStoppedUsing().

 

the last two has been set to shoot in semiautomatic  3 bullets burst, and actually:

- the critical parameter that make the bulets make double  damage in one of ten shoots  works,

- the damage based on type of munition works there is 3 type of munition for p90 gun

- but the part of the code that make a bullets pierce througt an entity and damage the next entity is not working i fix that later

 

i get lost in the topic.

wath i need is to make mi custom entity (yunno) able to hold rigth click (or set item in use) per 30ticks then release  as works for the little maid mod  mobs

this shall allow this custom entity to shoot vainilla bow and bows/guns for other mods, once i have this working ill fix the code for mi guns to have just one version of every gun compatible whith players, mi mobs and  little maids, and any other  mob entity able to do the same.

 

sorry for the bad english

thanks

 

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.