ModsFinder

Piston API

by jbredwards

Piston API lets block developers and modpack makers control how pistons push, pull and stick blocks, for Forge on 1.12.2.

ForgeClient and serverAll rights reserved1.12.2

What it does

Piston API gives blocks position- and world-sensitive interactions with pistons. A block can implement a small interface with one method that returns a push reaction for the piston and its surroundings, and a second interface that decides whether a block is sticky on a given side. Blocks that do not implement either interface fall back to the vanilla or Forge behavior. Tile entities can be made pushable, and pistons move them along with the blocks around them. Pistons also keep fluid states when they push, and chests can be set to stick to other pushed blocks.

Mod developers can use the API directly, while modpack developers can override a block's push or stick reaction through GroovyScript during postInit, without editing the original mod. A configurable push limit sets how many blocks a piston moves at once. Piston API is a Forge library and ships with examples for GroovyScript. Quark compatibility is listed as a supported integration, and the API is an addition to the game rather than a separate piston mod.

A server running it needs every connecting player to have it too. Files exist for Forge 1.12.2 only, and the latest file is 1.0.2 for 1.12.2, published 2024-04-14. The source code, an issue tracker and a wiki are public. The code is under All rights reserved, so the license does not allow redistribution as open source.

Key features

  1. Push reaction interface

    A block can implement one method that returns how a piston should treat it, depending on the piston and its position.

  2. Stickiness interface

    A second method decides whether a block sticks to a neighbor on a given side, with results for each neighbor tested.

  3. Overrides for existing blocks

    Push and stick results of a block can be replaced through GroovyScript during postInit, without changing the mod that adds the block.

  4. Pushable tile entities

    Tile entities can be pushed by pistons, and the API handles their movement with the blocks around them.

  5. Configurable push limit

    The number of blocks a piston can push at once is set in the config file.

  6. Breaking sounds and particles

    Blocks destroyed by pistons play their breaking sounds and particles.

Compatibility

Latest build for each game version and loader.

1.12.21.0.2
ReleaseBetaAlphaNot available

Only full game releases are shown. This mod publishes no snapshot builds.

How it compares

Full comparison

Fluid Interaction Tweaker is a Forge mod for 1.12.2 that is open source under the MIT License and runs on client and server, so it changes fluid behavior without a piston API. Advanced Jukebox is a Forge mod for 1.12.2 with All rights reserved, not open source, also on client and server. GroovyScript is a Forge mod for 1.12.2, open source under the GNU Lesser General Public License v3.0 only, and is the scripting tool that Piston API examples are written for.

ModLoadersGame versionsEnvironmentUpdated
Piston APIForge1.12.2Client and server2024-04-14
Fluid Interaction TweakerForge1.12.2Client and server2025-07-04
Advanced JukeboxForge1.12.2Client and server2025-12-18
GroovyScriptForge1.12.2Client and server2026-04-14

Questions

Does Piston API need GroovyScript to work?

No. The interfaces work without it. GroovyScript is only needed to change push and stick reactions from scripts during postInit.

Which Minecraft versions does Piston API support?

Only 1.12.2 on Forge. The latest file is 1.0.2 for 1.12.2, published 2024-04-14.

Does the server need Piston API?

Yes. Every player and the server need a copy of the mod.

In the catalog

Piston API is one of 3,514 Library mods on ModsFinder, and one of 1,576 Library mods for Forge. 2,920 mods support Minecraft 1.12.2.

More from jbredwards

All projects

Similar mods

What the author says

API Features: Give custom blocks advanced piston interactions Piston API gives blocks a way to have position & world sensitive interactions with pistons! Mainly the block's pushability, and its stickiness.
jbredwards, on the Modrinth page

Official listing

Owner
jbredwards
Published
2023-06-16
Updated on Modrinth
2024-04-14
Facts verified
2026-10-15

Tags