Limiting amount of mobs a player can tame

Started by Sai on

Topic category: Troubleshooting, bugs, and solutions

Joined Jan 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Limiting amount of mobs a player can tame

Hello!

I'm making a custom entity and I want the player to only be able to tame TWO of these entities for their whole lifetime, how would I do that?
I know I've got to use a player persistent variable and make it count up for every entity of this type that I've tamed, but I tried cancelling the tame procedure when the counter reaches two but it doesn't work and you can still tame more than two of the entity anyways, has anyone tried making anything like this, or at least know how it should be correctly implemented?

Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I had a similar problem with…
Sun, 04/27/2025 - 07:51

I had a similar problem with global variables when I tried to make a global world timer for actions that happened in my mod.