I seem to be having a problem with finding which AI makes mobs fly or how to so if anyone knows the code please post below because this helps me out alot!.
I have tried using the method from the other mob classes like skeleton/zombiepig/witherskeleton and none of them seem to work.
Here's the code i have been using
protected void setEquipmentBasedOnDifficulty(DifficultyInstance difficulty)
{
this.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(ModItems.BARBARIAN_SWORD));
}
Which i don't know if your suppose to make any renders in entitybarbarianmodel/render but if you have a solution for this please let me know, Also if you know what to do please post the code for it and don't tell me how to do it because i will most likely mess it up because i'm still kinda new to coding mobs and just started 3 days ago.
Hey so i made a mob and it's suppose to hold a sword which i have try'd multiple codes for it but the mob isn't holding the sword which i don't know if it's a render issue or the code is wrong but if anybody knows how to fix this please let me know.
@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?.
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.
0
I seem to be having a problem with finding which AI makes mobs fly or how to so if anyone knows the code please post below because this helps me out alot!.
0
I have tried using the method from the other mob classes like skeleton/zombiepig/witherskeleton and none of them seem to work.
Here's the code i have been using
protected void setEquipmentBasedOnDifficulty(DifficultyInstance difficulty)
{
this.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(ModItems.BARBARIAN_SWORD));
}
Which i don't know if your suppose to make any renders in entitybarbarianmodel/render but if you have a solution for this please let me know, Also if you know what to do please post the code for it and don't tell me how to do it because i will most likely mess it up because i'm still kinda new to coding mobs and just started 3 days ago.
0
Hey so i made a mob and it's suppose to hold a sword which i have try'd multiple codes for it but the mob isn't holding the sword which i don't know if it's a render issue or the code is wrong but if anybody knows how to fix this please let me know.
0
@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?.
0
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.
0
The version i'm in is 1.12.2 btw.