Started by
Snow256
on
Topic category: Help with Minecraft modding (Java Edition)
Good morning, good afternoon, or good evening! Does anyone know how I could create a limit for tamed mobs in my mod? I want the player to be able to tame only 5 mobs, and this should apply only to mobs from my mod, not those from the vanilla game.
Create a player persistent number variable then
The global trigger: Entity is tamed.
if event/target entity is subtype of (your mob)
if source entity is subtype of player:
if get Global: (variable name) > 5
cancel event
event/target entity in this case would be the mob that got tamed. Or instead of event/target entity is subtype of (your mob) you could make an entity tag for tamable mobs in your mod then do:
replace the "if event/target entity is subtype of (your mob)" with:
if is event/target entity tagged in entity tags as (your entity tag.)
Forgot to mention:
after if get Global: (variable name) > 5
else:
set Global: (variable name) to Get global: (variable name) + 1