-
GitHub Usage ->
README.MD- Automatic Completion for Beginners (though still weak up to now)
- Let your scripts look more like Java (not so similar)
Example (OOP style)
import { KScript } from "./base/script" import { BooleanSetting, KModule, TextArraySetting, TextSetting } from "./base/module" import "./extensions/array.extensions" const mod = new KModule("AutoL", "Player", "Auto send a message when target has been dead.", "", [ new BooleanSetting("OnlyPlayer", true), new TextSetting("Prefix", "@[LB]"), new TextArraySetting("Suffix", [ 'string 1', 'string 2', 'string 3', ]) ]) const PlayerEntity = Java.type("net.minecraft.entity.player.PlayerEntity") const debug = false const chat = debug ? Client.displayChatMessage : NetworkUtil.sendChatMessage let target: Entity | undefined = undefined; mod._attack = (event: { enemy: Entity }) => { if (event.enemy instanceof PlayerEntity || !mod.setting('OnlyPlayer')!.value) { target = event.enemy; } } mod._playerTick = () => { if (target?.isDead()) { // method_5477=getName chat(`${mod.setting('Prefix')!.getValue()} ${target.method_5477().getString()} ${mod.setting('Suffix')!.getValue().random()}`) target = undefined; } } new KScript("MyScript", "1.0.0", "KonohaScarlet", mod).init()Welcome to improve it together!!
-
Very cool.
-
K kawaiinekololis moved this topic from Scripts on
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login