Mod
Js Turret
No reviews yet
A Turret which can be controlled by Javascript
Fabric is a mod loader for versions 1.14+ of Minecraft, particularly popular for client side and optimization mods.
Community voices
Reviews
Click once to include, again to exclude, again to clear
No reviews yet. Be the first to review this project!
Get it on
Available Platforms
Compatibility
Supported Environments
About
Project Details
For authors
Embed Badge
If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.
Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.
Identifiers
Platform IDs
Resources
External Links
About
Description
Have you ever wanted to have a smart super lethal unbalance infinite ammo sentry? No? Well here it is.
With Js turretโข you can now terrorise your friends in a way smarter and way more targetable manner. Just place one down write some simple code in java script insert the code into the turret and let her rip.
With one single barrel and a fire rate of sixty shots per minute which all do an untested amount of damage she's a real threat to anyone. All you have to do is to write some basic code to target that one friend and you're good to go (or just copy the code from below).
Code
for (const target of entities) {
if (target.name === "YourFriend") {
block.lookAt(target.position.x, target.position.y, target.position.z)
block.shoot();
}
}
The crafting recipie is this

To insert the written code you can paste it into a book and quill and right click the turret block with it. All pages of the book will be combined and put one after the other.
Available Javascript functions
All of these functions are only available through the block structure.
lookAt(number x, number y, number z)
Makes the barrel look at a given coordinate.
Example:
block.lookAt(0, 1, 0);
shoot()
Shoots in the direction of the current facing.
Example:
block.shoot();
getPosition() -> Vec3dJS
Should return the position of the block with the Vec3dJS struct which contains x, y, z
Example:
const pos = block.getPosition();
rotatePitch(number degrees)
Rotates the turrets pitch by the given degrees.
Example:
block.rotatePitch(1);
rotateYaw(number degrees)
Rotates the turrets yaw by the given degrees.
Example:
block.rotateYaw(1);
In addition to these functions you have access to a list of near by entities with the entities const.
The entities const is a list of MinecraftEntity which is a structure with these values:
Vec3dJS position
The position of the entity in the Vec3dJS struct which contains x, y, z
String type
The entity type.
Example: entity.minecraft.player
String name
The name of the entity. This is either the player name or the entities name when renamed with a name tag. If neither of those are the case it is just the entity times name. Example: Squid or for items Slimeball or for players just the player name.
Versions
Files
Relations
Project Relations
More like this
Similar Mods
Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.
On ModDex
Community snapshot
By the numbers
Statistics
Want to reach Minecraft players?
We're looking for a server hosting partner to feature here and other parts of the site. Interested? Send us a message!
Get in touchGet it on
Available Platforms
On ModDex
Community snapshot
By the numbers
Statistics
Resources