Code of Copper Extensions

⭐ — (1 endorsements) 📥 106 downloads 📌 v0.1.1 📅 12/26/2023
⚪ Last updated 2023

By moxvallix · datapack

⬇ Download Mod Source: Modrinth ↗ 📅 Updated: 12/24/2023 📅 Created: 12/26/2023

🔍 Analysis

  • 🏆 #1253 of 2169 datapack mods in this game by downloads

📋 About This Mod

# Code of Copper Extensions This pack provides a couple additional functions to Code of Copper, aimed at providing functionality for those who would prefer to use the language in creative mode, or as an operator. Whilst made by one of the developers of Code of Copper, this pack is **unofficial**. While some functionality provided by this pack may one day make it upstream, much of it will not. ## Requirements - **This datapack will only work in versions 1.20.2 and higher** - **This datapack will not work without (https://modrinth.com/datapack/code-of-copper)** ## Provided Functions ### Exec Exec will run any command given to it, in a string. It runs as the bot, positioned at the bot. It allows multiple strings in the same function. ```ruby exec("time set day") # Set time to day exec("weather clear", "gamemode adventure @p") # Set weather to clear, and @p to adventure mode ``` ### Tp Teleports the selected entity to the given coordinates. Coordinates can be an integer, or a string. Defaults to "@s" if unset. Tilde `~` is relative to the bot. ```ruby tp(0, 64, 0) # Teleport bot (@s) to 0, 64, 0 tp(0, 64, 0, "@a") # Teleport all players (@a) to 0, 64, 0 tp("~", "~8", "~", "@p") # Teleport nearest player 8 blocks above the bot tp("~", 100, "~", "@p") # Teleport nearest player to Y 100, above the bot ``` ### Setblock Alternative to `place()`, doesn't require blocks in inventory. Coordinates can be an integer, or a string. Tilde `~` is relative to the bot. ```ruby setblock(:stone, 0, 64, 0) # Sets the block minecraft:stone at 0, 64, 0 setblock(:grass_block, "~", "~8", "~") # Sets the block minecraft:grass_block 8 blocks above the bot ``` ### Score Returns the score of the selected entity, as an integer. Defaults to "@p" if unset. ```ruby score("myscoreboard") # Returns the score of @p, fo scoreboard myscoreboard score("myotherscoreboard", "Moxvallix") # Returns the score of Moxvallix, for scoreboard myotherscoreboard ``` ### Scoreset Sets the score of the selected entity, from a given integer. Defaults to "@p" if unset. Returns the score set. ```ruby scoreset("myscoreboard", 8) # Sets @p to a score of 8 on scoreboard myscoreboard scoreset("myotherscoreboard", 123, "Gears_YT") # Sets Gears_YT to a score of 123 on scoreboard myotherscoreboard ``` ### Rule Returns the value of the given gamerule as an integer. If a value is given as a second argument, it sets the gamerule as such. Accepts either a string, integer or boolean as second value. ```ruby rule("keepInventory") # Returns the value of gamerule keepInventory (0 if false, 1 if true) rule("doFireTick", false) # Sets the gamerule doFireTick to false, returns 0 rule("randomTickSpeed", 5) # Sets the gamerule randomTickSpeed to 5, returns 5 ``` ### Run Runs a function given as a resource, and returns the value the function returns. ```ruby run(:foo) # Runs function minecraft:foo, returning what the function returns run(code:bar) # Runs function code:bar, returning what the function returns ```

# Code of Copper Extensions

This pack provides a couple additional functions to Code of Copper, aimed at providing functionality for those who would prefer to use the language in creative mode, or as an operator.

Whilst made by one of the developers of Code of Copper, this pack is unofficial. While some functionality provided by this pack may one day make it upstream, much of it will not.

## Requirements - This datapack will only work in versions 1. 20. 2 and higher - **This datapack will not work without (https://modrinth.com/datapack/code-of-copper)**

## Provided Functions ### Exec Exec will run any command given to it, in a string. It runs as the bot, positioned at the bot. It allows multiple strings in the same function.

```ruby exec("time set day") # Set time to day exec("weather clear", "gamemode adventure @p") # Set weather to clear, and @p to adventure mode ```

### Tp Teleports the selected entity to the given coordinates. Coordinates can be an integer, or a string. Defaults to "@s" if unset. Tilde `~` is relative to the bot.

```ruby tp(0, 64, 0) # Teleport bot (@s) to 0, 64, 0 tp(0, 64, 0, "@a") # Teleport all players (@a) to 0, 64, 0 tp("~", "~8", "~", "@p") # Teleport nearest player 8 blocks above the bot tp("~", 100, "~", "@p") # Teleport nearest player to Y 100, above the bot ```

### Setblock Alternative to `place()`, doesn't require blocks in inventory. Coordinates can be an integer, or a string. Tilde `~` is relative to the bot.

```ruby setblock(:stone, 0, 64, 0) # Sets the block minecraft:stone at 0, 64, 0 setblock(:grass_block, "~", "~8", "~") # Sets the block minecraft:grass_block 8 blocks above the bot ```

### Score Returns the score of the selected entity, as an integer. Defaults to "@p" if unset.

```ruby score("myscoreboard") # Returns the score of @p, fo scoreboard myscoreboard score("myotherscoreboard", "Moxvallix") # Returns the score of Moxvallix, for scoreboard myotherscoreboard ```

### Scoreset Sets the score of the selected entity, from a given integer. Defaults to "@p" if unset. Returns the score set.

```ruby scoreset("myscoreboard", 8) # Sets @p to a score of 8 on scoreboard myscoreboard scoreset("myotherscoreboard", 123, "Gears_YT") # Sets Gears_YT to a score of 123 on scoreboard myotherscoreboard ```

### Rule Returns the value of the given gamerule as an integer. If a value is given as a second argument, it sets the gamerule as such. Accepts either a string, integer or boolean as second value.

```ruby rule("keepInventory") # Returns the value of gamerule keepInventory (0 if false, 1 if true) rule("doFireTick", false) # Sets the gamerule doFireTick to false, returns 0 rule("randomTickSpeed", 5) # Sets the gamerule randomTickSpeed to 5, returns 5 ```

### Run Runs a function given as a resource, and returns the value the function returns.

```ruby run(:foo) # Runs function minecraft:foo, returning what the function returns run(code:bar) # Runs function code:bar, returning what the function returns ```

🤖 AI-enhanced — based on mod data

📊 Mod Details

Game
Minecraft Data Packs
Author
moxvallix
Version
0.1.1
Downloads
106
Endorsements
1
Category
datapack
Created
12/26/2023
Updated
12/24/2023
Game Versions
1.20.2, 1.20.3, 1.20.4
Tags
library

🔧 How to Install Minecraft Data Packs Mods

Download from Modrinth. Use Prism Launcher or drop into your mods folder.

📖 Full step-by-step install guide for Minecraft Data Packs →

Visit the official mod page for specific installation instructions for this mod.

🎮 Need cheat codes or console commands? Check ur gaming wiki for Minecraft Data Packs commands, item IDs, and more.

❓ Frequently Asked Questions

Which Minecraft Data Packs versions does Code of Copper Extensions support?

The author lists 1.20.2, 1.20.3, 1.20.4. Other versions may work but are untested by the author.

What is the latest version of Code of Copper Extensions?

Version 0.1.1, published 2023-12-24 with 106 downloads recorded at the source.

Keep browsing — more Minecraft Data Packs mods await

📋 All Minecraft Data Packs Mods 🏆 Top 25 📂 More datapack 👤 More by moxvallix 🔎 Similar Mods 🌐 Best datapack (All Games) 🔀 Check Compatibility ⚖️ Compare Mods 🆕 New Mods