Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

LiquidBounce Forum

  1. Home
  2. Resources
  3. Scripts
  4. [API] TypeScript based API for nextgen

[API] TypeScript based API for nextgen

Scheduled Pinned Locked Moved Scripts
scriptscriptapitypescript
2 Posts 2 Posters 1.9k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Konoha ScarletK Offline
    Konoha ScarletK Offline
    Konoha Scarlet
    wrote on last edited by kawaiinekololis
    #1

    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!!

    1 Reply Last reply
    0
    • kawaiinekololisK Offline
      kawaiinekololisK Offline
      kawaiinekololis
      Admin
      wrote on last edited by
      #2

      Very cool.

      1 Reply Last reply
      0
      • kawaiinekololisK 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
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      About
      • Terms of Service
      • Privacy Policy
      • Status
      • Contact Us
      Downloads
      • Releases
      • Source code
      • License
      Docs
      • Tutorials
      • CustomHUD
      • AutoSettings
      • ScriptAPI
      Community
      • Forum
      • Guilded
      • YouTube
      • Twitter
      • D.Tube
      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups