Jump to content

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


perromercenary00

Recommended Posts

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

 

Link to comment
Share on other sites

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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