#Hi again
1 messages · Page 1 of 1 (latest)
import {
world,
system
} from "@minecraft/server"
world.afterEvents.playerSpawn.subscribe(event => {
let player = event.player
let initial = event.initialSpawn
if (!initial) {
return
}
system.runTimeout(() => {
let entity = player.getComponent("minecraft:riding")?.entityRidingOn
if (!entity) {
return
}
if (entity.typeId == "custom:boat") {
entity.getComponent("minecraft:rideable")?.ejectRider(player)
}
},
10)
})
might work
make sure to change de entity identifier thingy to urs in the if (entity.typeId == "custom:boat")
That problem is... It's not 100% it would work
since the loading time of each player is different
world.afterEvents.playerSpawn.subscribe(({ player, initialSpawn }) => {
if (!initialSpawn) return;
const intervalId = system.runInterval(() => {
const riding = player.getComponent('riding')?.entityRidingOn;
if (riding?.typeId === 'minecraft:horse')
riding.getComponent('rideable')?.ejectRider(player);
else system.clearRun(intervalId);
});
});```

what?
nah, bro just too good ( i can kinda read it )
wouldnt that also theoretically mean that it would keep checking every tick if ur riding a different entity thats not a horse, and not do anything, just keep checking every tick, til you ride a horse and the eject u lmao-
( i kinda dunno since its kinda hard to read for me )
it will stop immediately
see the clearRun?
oh