#Check if entity is tamed

17 messages · Page 1 of 1 (latest)

spare current
#

Old 1.16.5 script I used before.

ItemEvents.entityInteracted(event => {
    let questTame = (entityName, qID) => {
        if (event.target.type == entityName && 
            event.target.func_152114_e && 
            event.target.func_152114_e(event.player)) {
            event.player.data.ftbquests.addProgress(qID, 1)
        }
    }
    questTame('cold_sweat:chameleon', '7240042625E84AD9');
})
gusty matrixBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

mossy nexus
#

and event.target.isOwnedBy(event.player) looks like what you want for your other one

spare current
mossy nexus
spare current
#

I decided to use this before you found out about that new thing:
if (event.target.type == 'cold_sweat:chameleon' && event.target.nbt.TrustedPlayers[0] == event.player.uuid)

mossy nexus
#

well more than one player can be trusted by the chameleon, that's why they rolled their own 'tame'.... so I'd be careful only checking the first id in the list

#

seems like any player who feeds it the right item can ride it

spare current
#

it told me i cant use event.player instead i had to use the uuid like so:

if (event.target.type == 'cold_sweat:chameleon' &&
        event.target.isPlayerTrusted(event.player.uuid)) {
    }
mossy nexus
#

that works, there were two methods for isplayertrusted anyways

spare current
raw kite
#

you mean you want to check entity tame using entityInteracted?

#
ItemEvents.entityInteracted(e =>{
    e.server.scheduleInTicks(0, ()=>{
        if(e.target.owner) e.server.tell("owner: " + e.target.owner)
    })
})
#

interact with entity → fire event → tame entity → start delayed checking

#

or use kjs additions, which "entity" is called "animal" there

spare current