Jump to content

LuciferK9

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by LuciferK9

  1. Hey, guys! Sorry for not replying before. I've been busy. I decided to do the same but for plugins instead. I wanted to do this because I like to create quick games for me and my sister, and it makes more sense to do it on a server. Thank you for your replies!
  2. I know Java is easy with intelliJ, the post was not about java being difficult, was about just wanting to code in a better language. I wasn't asking to include compatibility in Forge with another language, I was talking about creating a mod that exposes the API through RPC/IPC. It's not a feature request, that's why it's here in general discussion. I don't think a language should depend on an IDE. The only language (that I know) that lacks command line tools is java. Even C# with .NET Core already has better tooling that allows people to write code efficiently without using a full IDE. D, GoLang, Rust and modern C++ are just as easy as java. But using these languages you have a set of features that you can opt-in if you want to write lower-level code or make some hand-crafted optimizations.
  3. I just started playing minecraft after a few years of not playing anymore, so I don't know much about Forge. Sorry for my ignorance in advance. I was thinking about a mod that exposes an API to allow players to create a "mod" in any programming language (I'm going to refer to these "mods" as "xmods" to differentiate them from forge mods). Not the full Forge's API, just a subset of it, like events, or anything that can be exposed. Basically, the mod would receive messages from xmods and do whatever they say and send messages to them telling them whatever it is happening in the minecraft world. I haven't thought about the specific details of the implementation, but for the messages we could use something like protobuf or flatbuffers, this way we could specificate the schema for the API and use it in different languages easily. The communication could be over TCP, or maybe the mod could spawn the xmods in child processes and communicate over stdin/stdout. The schema could look something like: message CommonEntityProps { Vector3 coordinates; int32 life; ... } message ServerEvent { optional PlayerPlacedBlockEvent player_placed_block = 1; ... } message Entity { ... } message Player { required CommonEntityProps common; ... } message Block { required Vector3 coordinates; required BlockType type; ... } message PlayerPlacedBlockEvent { required Player player; required Block block; ... } This is not supposed to be a replacement to mods. Just a way to easily create custom content without having to download and learn forge and without the trouble that java brings (for people that don't like it). Maybe someone has an idea and needs to quickly make a prototype and they decide to use python or javascript, just to test it and have fun in single player or lan with friends. This would also allow to create, automatize and invent new stuff very quickly. Imagine a player trying to build a giant pyramid where every 3 blocks there is a diamond block or something, this could be easily created in a script with less than 10 lines of code, and when you get to the top, you get burn because there's a god punishing you. Yesterday I was trying to create a basic game mode where you have to throw a player out of a platform, kill the player automatically if they're below an Y coordinate, and give them full armor and custom items after they respawn, I had problems making it with just command blocks. I would've liked to use some if statements but could not afford setting up forge, read the documentation, and probably download intellij because from what I remember, it's a pain in the *** to code java in something like vim or any other editor that is not an IDE. Some code in Rust on how I would like this to look like: use forge_xmod::{ Client, Event, player::{ Player, Inventory }, minecraft::{ Enchantment, Item }, }; fn main() { let client = Client::connect("127.0.0.1:9999"); loop { while let Some(event) = client.poll_event() { match event { Event::PlayerPlacedBlock(player, block) => { println!("The player {} placed a block ({}) on: {}", player, block, block.coordinates); }, Event::PlayerMoved(player) => { if player.coordinates.y < 50 { // this would send a TCP? packet, telling the mod to kill said player. Serialized with protobuf? player.kill(); } }, } } for player in client.players() { if !player.inventory.contains(Item::DiamondSword) { let mut item = Item::DiamondSword; item.enchant(Enchantment::Sharpness, 4); player.inventory.insert(item); // send packet } } } } I could just then compile it, run it and it would already work. Other person could do the same in JavaScript, C++, etc. I want to read your opinions and see if anyone is interested in working on something like this. As I said, I don't know much about Forge, so I would like some help since I plan to make this anyways, at least to fit my needs. I would help to find where the main Forge APIs are located to see if I can generate the schema programatically.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.