Limiting amount of mobs a player can tame

Started by Sai on

Topic category: Troubleshooting, bugs, and solutions

Active 5 hours ago
Joined Jan 2023
Points:
258

User statistics:

  • Modifications: 1
  • Forum topics: 3
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 4
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?

Active 1 week ago
Joined Oct 2022
Points:
422

User statistics:

  • Modifications: 1
  • Forum topics: 10
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 155
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.