Add the ability to change tame chance

Started by Legalo on

Topic category: Feature requests and ideas for MCreator

Last seen on 05:02, 4. Oct 2024
Joined Oct 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Add the ability to change tame chance

This shouldn't be too hard to implement just add an integer box next to the Can tame check box that accepts values from 0 to 100 and then change the living entity template line from
if (this.random.nextInt(3) == 0 && !net.minecraftforge.event.ForgeEventFactory.onAnimalTame(this, sourceentity))
to
if (this.random.nextInt(100) <= {tameChance-1} && !net.minecraftforge.event.ForgeEventFactory.onAnimalTame(this, sourceentity))

Where tameChance is the value from the integer box, you can also set the default value to 33 to mantain the original functionality