r/ComputerCraft • • 4d ago

How does computercraft work??

So I've been scrolling through this community and I wonder how does this mod work. Likee what does it at and what functions does it have?

10 Upvotes

8 comments sorted by

9

u/IJustAteABaguette 4d ago

Super simply, you have a computer block that can run your own Lua code.

It also has a bunch of "peripherals". Basically just extra components to interact with the world. Sending data to other computers wirelessly, changing redstone signals, monitors, reading of block data, moving around items in and between chests.

Also there's a turtle variant that can do all those things, but also move around, mine/attack stuff and has an inventory. The moving around part does cost fuel.

4

u/Professorkatsup 3d ago

In a "how does modding work at all" sense, I have no idea. Haven't touched java seriously.

In a "what can this mod be used for" sense, there's a fair bit. The most "useful" things I end up using computers for are redstone and create contraption control. I've made storage networks before as well, but none good enough to warrant not including an actual storage / logistics mod.

2

u/Flat-Panic8622 4d ago

it's a logistics mod like SFM, LogisticsNetworks, IntegratedDynamics

but all actions your blocks from this mod (computer, turtle, peripherals) performed by executing Lua code.

Also because of that it can do some things beyond.

→ More replies (2)

2

u/RamielTheBestWaifu 3d ago

Lue interpreter in a java mod I guess

1

u/Spkels29 2d ago

Lua interpreter is open source, all the mod developers really had to do was create a API so the lua code can interact with the computer it’s self and peripheral (bit of a oversimplification but gives you the general idea)

1

u/TheGoldenFox64 1d ago

its a basic computer. you can use it like a basic computer (you may be thinking of a GUI or desktop enviroment, this is not that). it uses Lua, which is a real programming language, for whatever you would use a programming language for. you can also interface with the minecraft world, emitting redstone and controlling other modded blocks, for example.