Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • 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. Nextgen 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 553 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
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

      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