how to check if player is in minecart using /execute code example
Example: how to check if player is in minecart using /execute
/execute as @a[nbt={RootVehicle:{Entity:{id:"minecraft:minecart"}}}] run ...
/execute as @a[nbt={RootVehicle:{Entity:{id:"minecraft:minecart"}}}] run ...