Download Js Turret — Minecraft Mods — MetaMods
Js Turret

Js Turret

Active

Downloads

0

Last update

6 months ago

Versions

1.21.5
Client and server
Fabric
Weapons and armor
Technological

Js Turret

Meet the revolutionary defense and attack system for Minecraft - the programmable turret Js Turret™! This is not just ordinary weaponry, but a true intelligent guardian that executes your commands with unprecedented precision.

Imagine this: you place one such installation, write a few lines of JavaScript code, and the turret transforms into the most loyal and ruthless protector of your territory. Want it to guard only against a specific player? Please do! Need automatic territory patrol? Easy!

This smart turret is equipped with a single barrel and a fire rate of 60 shots per minute, each dealing significant damage. Ammunition is unlimited, making the installation perfect for long-term defense or attack.

The programming process is intuitive: write code in a book and quill and right-click the turret block. All pages of the book will be sequentially combined and loaded into the system.

How Crafting Works

The turret crafting recipe uses standard materials and components, making the installation accessible to most players.

JavaScript Functions for Programming

All functions listed below are available through the block structure.

Code Target Example

Programming Example javascript for (const target of entities) { if (target.name === "YourFriend") { block.lookAt(target.position.x, target.position.y, target.position.z) block.shoot(); } }

lookAt(number x, number y, number z)

Directs the barrel to the specified coordinates.

block.lookAt(0, 1, 0);

shoot()

Fires a shot in the current direction.

block.shoot();

getPosition() -> Vec3d JS

Returns the current block position in the Vec3dJS structure with x, y, z fields.

const pos = block.getPosition();

rotatePitch(number degrees)

Rotates the turret's vertical angle by the specified number of degrees.

block.rotatePitch(1);

rotateYaw(number degrees)

Rotates the turret's horizontal angle by the specified number of degrees.

block.rotateYaw(1);

Entity Information

You also have access to a list of nearby entities through the entities constant. This is a list of MinecraftEntity structures with the following properties:

Vec3dJS position

Entity coordinates in the Vec3dJS structure containing x, y, z values.

String type

Entity type, for example: entity.minecraft.player.

String name

Entity name - this is either the player's name or the entity name changed using a name tag. In other cases, standard names are used, such as "Squid" for squid or "Slimeball" for an item.

Project members
Herr_Chaos

Herr_Chaos

Developer

Created: 19 Apr 2025

ID: 86372