#Ride Everything.

4 messages · Page 1 of 1 (latest)

deft inlet
#

You can literally ride everything using these codes.
I use reflection to set the access. But I won't teach anything evil so don't ask me about them.💀
The entity mounted will attack any enemies targeing their passenger, this is the coolest part I believe.

#

ServerScripts:

ItemEvents.entityInteracted((event) => {
    const { player, target } = event;
    if (target.type == "minecraft:warden" || target.type == "minecraft:wither") return;
    player.startRiding(target);
});

ItemEvents.firstLeftClicked(event=>{
    if (event.hand != "MAIN_HAND") return;
    if (event.player.getVehicle() == null) return;
    const target = event.player.rayTrace(10, false).entity;
    const item = event.item.id;
    let vehicle = event.player.getVehicle();
    if (target != null) {
        vehicle.setTarget(target);
    }
    if (item == "minecraft:stick") {
        event.player.getVehicle().setTarget(null);
    }
})
#

StartScripts: