Scooter User's Manual

User's Manual and Technical Reference Page under construction
  1. Initial Setup
    1. Requirements
    2. Use on Dedicated Servers
    3. Quilt and Fabric support
  2. Scooters
    1. The Kick Scooter
    2. The Electric Scooter
  3. Tires
  4. Charging Station
  5. Technical Reference
    1. Riding Physics
    2. Registry Entries

Initial Setup

Requirements

STUB: Fabric Loader or compatible, Fabric API or compatible.

Use on Dedicated Servers

Scooters Mod is required on both sides of the server-client paradigm. Server-side provides items and entities players can interact with and client-side provides the physics.

Note that Scooters Mod does not provide a warning to players connecting without it installed on the client. Instead, the underlying copy of Minecraft will complain about missing registry entries. Interoperability with mods that register the same identifiers or resource locations is not guaranteed. For a table of what's registered, see Registry Entries.

Quilt and Fabric support

STUB: Scooters Mod was started as a Fabric mod, before public betas of Quilt existed. 1.0.x will be the only releases targeting Fabric Loader. In the future, Scooters will be retooled for Quilt.

Scooters

STUB: see the Quick Start Guide

The Kick Scooter

STUB: see the Quick Start Guide

The Electric Scooter

STUB: see the Quick Start Guide

Tires

STUB: see the Quick Start Guide

Charging Station

STUB: see the Quick Start Guide

Technical Reference

This section uses Yarn names, and names based from it.

Riding Physics

Note: this section uses MathML. Please use a web browser with support for MathML.

These are the physics for a player riding a scooter.

Rotation

First we need to calculate how much we spin in a frame:

Δϑ = { -θaccel steering left; 0 going straight; +θaccel steering right.

Negative rotation in Minecraft is counter-clockwise, as viewed from above. We can then set our rotation and also apply some decay to it with:

ϑ' = ϑ × 0.8 + Δϑ

Movement

Because movement is a terrible hacky mess, it doesn't follow any principles.

Variables and their meanings
Variable Meaning
t Tire resistance, used for popped tires
i Momentary inertia, used for speed decay and active braking. 0 ≤ i ≤ 1
Ibase Base inertia, a constant defined by scooter type
Icoast Inertia while coasting, a constant defined by scooter type
fb Brake force, a constant defined by scooter type
A Acceleration on throttle, a constant defined by scooter type
Vxz The maximum horizontal speed achievable, defined by scooter type

We calculate horizontal movement using speed and vectoring it. One of the variables for it is inertia, but a better name for it may be resistance. It is calculated as such:

i = { t × fb × I base if braking ; I base if accelerating and vxz < Vxz ; I coast when else.

Next, we calculate the acceleration and speed. There's no jerk so acceleration is quite simple. Calculations for speed, as previously stated, is based on the length of the speed vector in X-Z:

a = { A × t if accelerating; 0 when else. vxz = | v × ( 1 , 0 , 1 ) | + a

We can now apply our speed using the new calculated speed, the inertia, and the new angle:

v' = ( - sin ϑ' × vxz × i , vy - 0.04 , cos ϑ' × vxz × i )

Registry Entries

Registry Entries Reference
Registry Identifier Description
Entity Types scooters:kick_scooter The rideable Kick Scooter vehicle, proper.
scooters:electric_scooter The upgraded version, the Electric Scooter entity.
Blocks scooters:charging_station The physical block in the world representing a Charging Station, which you can interact with. This block has no logic and all logic is delegated to the block entity.
Block Entity Types scooters:charging_station The logical Charging Station with e-scooter attaching and detaching logic. Charging Station block entities should be automatically created and deleted when manipulating the charging station block.
Items scooters:kick_scooter The item representing a Kick Scooter, which you can immediately place in the world and gets dropped from kick scooters.
scooters:electric_scooter The item representing an Electric Scooter, which you can immediately place in the world and gets dropped from electric scooters.
scooters:charging_station The item representing a Charging Station, which you can immediately place in the world and gets dropped when the block is mined or exploded.
scooters:tire The Tire item. This item must be damageable with durability of 640.
scooters:raw_tire The Raw Tire item, which cannot be directly used by scooters and must be vulcanized first. This item must have a maximum stack size of 16.
Screen Handlers scooters:scooter The logical part of the scooter UI, and handles moving items into and from a scooter.
Screens registered to the scooter screen handler The graphical part of the scooter UI, and handles drawing a usable UI on the videogame.
Block tags scooters:abrasive This block tag controls which blocks decrease the durability of tires more quickly. The blocks themselves in the tag are controlled with a data pack, the JSON file located at data/scooters/tags/blocks/abrasive.json.
Packets scooters:esctup
Client to server
This packet is used to inform if you're using the throttle on an electric scooter or not. The name means Electric Scooter Throttle Update.
scooters:invchange
Server to client
This packet is used to inform clients about the inventory of a scooter. Effects of this packet are synchronized visuals and handling characteristics. The name means Inventory Changed.
Sound Events scooters:entity.roll The sound a scooter makes when rolling around.
scooters:entity.tire_pop The bang or pop a tire makes when its durability is depleted entirely.
scooters:charger.connect The sound of connecting an e-scooter to a charging station.
scooters:charger.disconnect The sound of disconnecting an e-scooter from a charging station.
Recipe Serializers scooters:kick_scooter_craft This recipe serializer is responsible for the kick scooter recipe where the NBT data of the tires is preserved when crafting a scooter. The crafting recipe is not defined in any JSON files, but the JSON files are required for the recipe to actually work.
scooters:electric_scooter_craft This recipe serializer is responsible for the scooter electrification recipe where the NBT data of the scooter is preserveed when electrifying it. The crafting recipe is not defined in any JSON files, but the JSON files are required for the recipe to actually work.
Entity Model Layers scooters:scooter Required by rendering, represents the 3D model of a scooter.
Entity Renderers registered to the logical kick scooter entity Required by rendering to give instructions on how to draw a scooter on the videogame.
registered to the logical electric scooter entity Required by rendering to give instructions on how to draw a scooter on the videogame. This is the same entity renderer as before.