there's a method called setHeldItem(). Call this method. Assuming your entity extends EntityLivingBase or any subclass
I did do it but what do i put in stack, I put in hand MAIN_HAND but what would i put in stack for a stone sword?, and i did just fix it and it still doesn't work.
@Override
public void setHeldItem(EnumHand hand, ItemStack stack) {
this.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(Items.STONE_SWORD));}
Which just to let you know i'm kinda new to coding entites so it's probably something simple that i don't know then sorry, Also with the Items.stone_sword can i do moditems. then it will appear my swords or weapons i want the entity to hold?.
The version i'm in is 1.12.2 btw.
there's a method called setHeldItem(). Call this method. Assuming your entity extends EntityLivingBase or any subclass
I did do it but what do i put in stack, I put in hand MAIN_HAND but what would i put in stack for a stone sword?, and i did just fix it and it still doesn't work.
Wait, show what you did. If it's not fixed already.
@Override
public void setHeldItem(EnumHand hand, ItemStack stack) {
this.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(Items.STONE_SWORD));}
Which just to let you know i'm kinda new to coding entites so it's probably something simple that i don't know then sorry, Also with the Items.stone_sword can i do moditems. then it will appear my swords or weapons i want the entity to hold?.