Jump to content

[1.8] Stuck how to check if custome entity has this particular item ?


Recommended Posts

Posted

 

Good Nigths

 

im triying something messy to fix this trouble, and the trouble is mi guns dont work went hold by entityes

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

 

 

what i got done,

 

actually experimenting whith the basic wooden bow,  when you swing or rigth click, this bow  spawn an ghost entity that first check if the holder of the bow is a valid player or any other entity

if is a player it does nothing just let the bow works like always,

but if this is a mob, a villager or any other entity the ghost triger the bow animation, thigthen and  shoot and arrow based of what kind of arrows the entity has in its inventory.

and thats the point i get stuck

 

entityes has a basic inventory but im realize not how to get the inventory size,  im prety sure squeletons zombyes and mi custom entity has a base of only 5 slots

the method :

playerIn.inventory.getSizeInventory()  only works on EntityPlayer but not in entityLivingBase so ican't not use it to get the size

 

i need size to make a loop to check all the invetory slots

 

once i get the size either way i think i could use entity.getCurrentArmor(slotIn) or  entity.getEquipmentInSlot(slotIn)  to check the slots  in search for bullets or arrows

 

 

thanks for your help

 

 

 

 

 

 

 

 

 

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.