Skip to content

TCMB-Project/rail_mo_plus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RailMoPlus

Ask DeepWiki
日本語版

Note: This document is a translation of the original Japanese README. Some translations may not be perfect.

rail_movement for high-speed driving

Usage

1. Installation

Copy the build directory into the scripts directory of your behavior pack.
You can use a submodule to keep up with updates.

git submodule add https://github.com/TCMB-Project/rail_mo_plus.git

If you are using @minecraft/server 1.19.0 or earlier, please use the v1 branch.

cd rail_mo_plus
git checkout v1

2. Import

For JavaScript:

import { RailMoPlusEntity } from "./build/rail_mo_plus.js";

For TypeScript:

import { RailMoPlusEntity } from "./src/rail_mo_plus.ts";

Example

An example where an entity "foo:bar" always moves at 10km/h on rails:

import { world } from "@minecraft/server";
import { RailMoPlusEntity } from "./build/rail_mo_plus.js";

const entities = new Map();

world.afterEvents.entitySpawn.subscribe((e) => {
  const entity = e.entity;
  if(e.entity.typeId !== "foo:bar") return;
  const railInstance = new RailMoPlusEntity(entity);
  railInstance.setSpeed(10);
  entities.set(entity.id, railInstance);
});

License

MIT License

About

rail_movement for high speed driving

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published