execute as @e[type=interaction,tag=SEAT] run data remove entity @s interaction

scoreboard players remove @a[scores={seatTimer=1..}] seatTimer 1

Tutorial viewed            times

execute as @e[type=interaction,tag=SEAT] on target run ride @s mount @e[type=minecraft:interaction,nbt={interaction:{}},limit=1,sort=nearest]

scoreboard players set @a[nbt={RootVehicle:{Entity:{Tags:["SEAT"]}}}] seatTimer 2

 ▶ [Set on 'repeat' and 'always active'] The first command (the one at the bottom) gives a score of 2 on the 'seatTimer' scoreboard to all players riding the entities tagged 'SEAT'


 ▶ [Set on 'chain' and 'always active'] When players have a score of 1 on the 'seatTimer' scoreboard, the second command (the one in the middle) teleports them to the wanted position. Make sure to change the zeros in red (0) with the coordinates of the invisible horse in your world and the zeros in yellow (0) at the end of the command with the amount of blocks you want the player to be moved on the X, Y and Z axis.


 ▶ [Set on 'chain' and 'always active'] The third command (the one at the top) decreases the player's score on the 'seatTimer' scoreboard by 1 each game tick. Basically, as long as players are riding the invisible horse, their score will always be '2' but when they dismout it, their score will be decreased by this command. By doing so, as soon as players dismount the horse, after exactly one game tick, their score will be decreased to '1' so the second command block detects them and runs the /tp command accordingly. Then the player's score is decreased to '0' so at this point nothing happens.


▶ [Command used to rotate the invisible horse​Go near the invisible horse you want to rotate and paste in chat the following command:

/data merge entity @e[type=horse,tag=SEAT,distance=..3,limit=1,sort=nearest] {Rotation:[0f,0f]}


▶ [Command used to remove the invisible horse] ​Go near the invisible horse you want to remove and paste in chat the following command:
/kill @e[tag=SEAT,distance=..4,limit=2,sort=nearest]

execute as @a[scores={seatTimer=1..1},x=0,y=0,z=0,distance=..2] at @s run tp @s ~0 ~0 ~0

This small command modification allows you to sit anywhere (even on mobs) in your vanilla Minecraft Java worlds. It works in 1.19.4 and newer versions.

SIT ANYWHERE IN MINECRAFT

Method 1: Using Interaction Entities

 ▶ [Set on 'repeat' and 'always active'] The first command (the one at the bottom) runs a /ride command on the player that right-clicks on the interaction entity. It makes that same player ride the same interaction entity that it right-clicked on.

We are executing the command as the interaction entities (tagged "SEAT") and then ON the player right-clicking them (which in this case become the target).


 ▶ [Set on 'chain' and 'always active'] The second command removes the "interaction" NBT data from the interaction entity. When those entities are right-clicked, they receive an NBT tag named "interaction", think of it as a tag that is given when a player interacts with it. The first command lets the player ride the entity that just received this NBT tag and this command removes the NBT tag so the /ride command isn't continuously run on the player.


 ▶ [Command used to summon the interaction entity] Place down a normal 'impulse' command block on the place where you want the players to be able to sit and paste inside it the following command (as shown in the video):  summon interaction ~ ~-.73 ~ {Tags:["SEAT"],NoGravity:1b,width:1f,height:0.23f}


▶ [Command used to remove the interaction entity​Go near the interaction entity that you want to remove and paste in chat the following command:

/kill @e[tag=SEAT,distance=..4,limit=1,sort=nearest]


▶ [Command used to sit on mobs] ​After summoning the interaction entity as shown in the video, go near the mob you want to ride, place down a normal 'impulse' command block, paste the following command and activate it (change 'villager' with the name of the mob you want to ride):
ride @e[tag=SEAT,distance=..15,limit=1,sort=nearest] mount @e[type=villager,limit=1,sort=nearest]




Method 2: Using Invisible Horses

▶ [Commands used to create a team that removes collision] Type in chat the following two commands and activate them in order as shown in the video (you'll need to do this only once in your world):

/team add NOCOLLISION

/team modify NOCOLLISION collisionRule never


▶ [Command used to summon the invisible horse] Place down a normal 'impulse' command block on the place where you want the players to be able to sit and paste inside it the following command (as shown in the video):

summon block_display ~ ~-2.05 ~ {Tags:["SEAT"],Passengers:[{id:"minecraft:horse",NoGravity:1b,Silent:1b,Invulnerable:1b,DeathLootTable:"0",Team:"NOCOLLISION",PersistenceRequired:1b,NoAI:1b,Health:6f,Tame:1b,Tags:["SEAT"],CustomName:'{"text":"Seat"}',ActiveEffects:[{Id:10,Amplifier:99b,Duration:999999999,ShowParticles:0b},{Id:11,Amplifier:99b,Duration:999999999,ShowParticles:0b},{Id:14,Amplifier:1b,Duration:999999999,ShowParticles:0b}],Attributes:[{Name:generic.max_health,Base:6}],ArmorItem:{},Rotation:[90f,0f]}]}




Fix position when dismounting horse

▶ [Command used to create a scoreboard objective] Type in chat the following command (you'll need to do this only once in your world):

​​/scoreboard objectives add seatTimer dummy


Then set up the following command block chain: