#Is there a way to do auto tame when a mob is summoned
1 messages · Page 1 of 1 (latest)
You can use scripts. This example summons a tamed wolf when a player right clicks with a bone:
import { world } from "@minecraft/server";
world.afterEvents.itemUse.subscribe(({ source, itemStack }) => {
if (source.typeId !== 'minecraft:player') return;
if (itemStack.typeId !== 'minecraft:bone') return;
const location = source.location;
const dimension = source.dimension;
const target = dimension.spawnEntity('minecraft:wolf', location);
const tameable = target.getComponent('tameable');
if (tameable) {
tameable.tame(source);
}
});
Pretty sure there is without using a script
What would that be? I didn't find a way with just commands and scripts have a native method for tame.
Hmm maybe ”events” can help to do that
It is by using events when summoning a projectile and adding when summoned
Wait I'll find it
@torn mesa This is what you mean?
You can summon tamed mobs with just commands. But Wolfs and Cats will not be tamed to the player.
In this example, I added a hasitem activation method so mobs are only summoned once.
execute as @a[hasitem={item=stick, location=slot.weapon.mainhand}] at @s positioned ^^^2 run summon horse ~~1~ facing @s minecraft:on_tame
replaceitem entity @a[hasitem={item=stick, location=slot.weapon.mainhand}] slot.weapon.mainhand 0 air
This can have interesting results. Tamed Piglins do not transform into Pigmen in the Overworld. Zombies are crazy fast.
Lol no there is a way xd here let me show you an example
{
"format_version": "1.16.0",
"minecraft:entity": {
"description": {
"identifier": "minecraft:example",
"runtime_identifier": "minecraft:arrow",
"is_spawnable": false,
"is_summonable": true,
"is_experimental": false
},
"components":
"minecraft:projectile": {},
"minecraft:transformation": {
"into": "minecraft:example<minecraft:on_tame>",
"keep_owner": true
}
}
}
}
So what's this do?