Jump to content

Recommended Posts

Dear Minehut Team,

I would like to suggest a new plugin called Scriptcraft (https://github.com/walterhiggins/ScriptCraft) with this plugin you can code in javascript to create wonderful creations. It allows players to get a new opportunity to code in a new language sense Skript does not have any extensions for Javascript. I hope you guys / girls can understand, And I thank you for all of your time reading this. Talk to you guys later.

- Sebastian (MT_Sinbad)

Minehut DEFAULT - Sometime in 2017

Minehut PRO - September 13th 2019

(GIVEN x4) Minehut VIP - (SEE ABOUT ME)

Link to post
Share on other sites
1 minute ago, Avipexe_ said:

i thought this was a skripting addon LOl

 

and I don't think this would be added if it supported JavaScript.

 

but would be cool if it was added

I was trying to find any updated skript javascript add-ons to suggest but I couldn't find any.

Minehut DEFAULT - Sometime in 2017

Minehut PRO - September 13th 2019

(GIVEN x4) Minehut VIP - (SEE ABOUT ME)

Link to post
Share on other sites
  • 2 months later...

Personally I'd really like to see this or some well supported and powerful alternative to Skript added. I'm a bit new to the Minehut community in general, but what's so bad about JavaScript? If it's about security, all that really needs to be done is simply writing a quick modification to some existing plugin such as ScriptCraft which disallows access to the file system assuming it allows for that at all. This would most likely be as simple as locating the APIs interfaced with JS code and changing several lines to throw an exception, return undefined, etc. I genuinely want to know what the argument is against allowing other languages when other languages can be so powerful for MC servers.

The first real argument I want to give is that, personally, I think Skript is extremely difficult to work with due to a lack of documentation. I couldn't find a clean way to simply override block drops, I had to implement my own block dropping code even though MC already handles all of this for you. That means I'd have to somehow implement fortune code into Skript if I wanted fortune to work like it does in game and that could be a monstrous task. Additionally, it doesn't seem to support functions, return arguments, etc. You have to basically hack this all in through weirdly scoped variables, creating impossible to execute commands and executing them, and generally just really frowned upon methods that no other language would allow for let alone support at all.

Here's an example. Let's say I want to define an internally used piece of code to check if a user is an admin in my game. In JavaScript I might have something like this:

const admins = []; // A list of administrator users

let giveAdmin = function(uuid) {
	if (!admins.includes(uuid)) // Is uuid not in list?
		admins.push(uuid); // Put uuid into admins list
};
let revokeAdmin = function(uuid) {
	if (admins.includes(uuid)) // Is uuid in list?
		admins.splice(admins.indexOf(uuid), 1)); // Remove uuid from list
};
let isAdmin = function(uuid) { // Checks if user is admin
	return admins.includes(uuid); // Simply see if their uuid is in the list
};

This is extremely straight forward and every function and object used here is extremely well documented on sites such as mozilla's documentation site. If you're unaware of what Mozilla is, they develop the Firefox web browser. You could use this JS code for tons of things on virtually any modern OS and I wrote it in about 30 seconds.

For people who are better at Skript than me, what would be a non hacky way to implement this into Skript if there even is one?

My second argument is that SO many things can be transpiled into JS. JS can be implemented on virtually any OS in C/C++ code, C#, Java (not to be mistaken with JS!), and so many more. It's used almost everywhere. People have wrote JS engines in vanilla lua, python, JS itself. JS is an extremely widely used language and hundreds of thousands of websites now use JS server sided, not just on the webpage. Discord only supports writing bots in JS. You can find support for JS syntax pretty much anywhere. As far as I can tell, no programming language > Skript transpilers exist partially because its not very widely used by anyone and additionally it's not a fully featured language and should not be used like one.

My third argument is this. As someone who has been programming for almost 10 years now (I'm 16, almost 17, yes I have genuinely been programming for more than half of my life now) I can safely say that Skript is a terrible way to learn to program. It has absolutely terribly ambiguous syntax, other concepts cannot be applied to other languages, is hardly turing complete or at least makes it extremely difficult, and most pretty trivial tasks for MC or programming in general are insanely complicated or hacky due to Skript's syntax.

In conclusion, I hate Skript because of what it teaches and how hard it is to use concepts anywhere else or apply concepts from anywhere else. You might disagree with me and that's okay, but I can hardly use Skript with 9 and a half years of programming due to how utterly confusing it is compared to all other languages I've used. That most likely means I'm not Skript's demographic, but there is nothing for my demographic. Give me any other language interfaced to MC and I could be doing some insane stuff that I just can't do with Skript. Please Minehut staff, consider some plugin support for standard programming languages.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...