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. ScriptAPI
  3. mc.thePlayer is undefined

mc.thePlayer is undefined

Scheduled Pinned Locked Moved Unsolved ScriptAPI
5 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.
  • 182exe1 Offline
    182exe1 Offline
    182exe
    wrote on last edited by
    #1
    /// api_version=2
    var script = registerScript({
        name: "AutoStrafe",
        version: "0.0.0",
        authors: ["182exe"]
    });
    
    script.registerModule({
        name: "AutoStrafe",
        category: "Combat", // Movement, Misc, Combat, Fun, Player, Exploit, World, Render
        description: "Automatically strafe players"
    }, function (module) {
        module.on("update", function () {
            Chat.print(mc.thePlayer)
        });
    });
    

    efbb4fb2-8d97-450f-a865-3fc472d518e0-image.png

    anyone know what i'm doing wrong?

    kawaiinekololisK 1 Reply Last reply
    0
    • 182exe1 182exe
      /// api_version=2
      var script = registerScript({
          name: "AutoStrafe",
          version: "0.0.0",
          authors: ["182exe"]
      });
      
      script.registerModule({
          name: "AutoStrafe",
          category: "Combat", // Movement, Misc, Combat, Fun, Player, Exploit, World, Render
          description: "Automatically strafe players"
      }, function (module) {
          module.on("update", function () {
              Chat.print(mc.thePlayer)
          });
      });
      

      efbb4fb2-8d97-450f-a865-3fc472d518e0-image.png

      anyone know what i'm doing wrong?

      kawaiinekololisK Offline
      kawaiinekololisK Offline
      kawaiinekololis
      Admin
      wrote on last edited by
      #2

      If this is Legacy, it might be that the remapper does not function properly or the mappings were not downloaded correctly. Might check inside your LiquidBounce folder and delete the mcp-stable_22.srg file and try starting the game.

      Otherwise, please share logs, they might help us to find the issue.

      If you use Nextgen use mc.player.

      1 Reply Last reply
      0
      • 182exe1 Offline
        182exe1 Offline
        182exe
        wrote on last edited by
        #3

        mcp-stable_22.srg is 0kb, so i'll delete it and see how it goes.
        if you've got a download for one that i can just replace it with then that'd be appreciated?

        1 Reply Last reply
        0
        • 182exe1 Offline
          182exe1 Offline
          182exe
          wrote on last edited by
          #4

          it regenerated as a 0kb file once again, by the way
          i'm on legacy.

          1 Reply Last reply
          0
          • 182exe1 Offline
            182exe1 Offline
            182exe
            wrote on last edited by
            #5

            @kawaiinekololis
            this is what prints if I'm just asking for mc.thePlayer

            [15:58:47] [Client thread/INFO]: [CHAT] undefined
            [15:58:47] [Client thread/INFO]: [CHAT] undefined
            [15:58:47] [Client thread/INFO]: [CHAT] undefined
            [15:58:47] [Client thread/INFO]: [CHAT] undefined
            [15:58:47] [Client thread/INFO]: [CHAT] undefined

            and if i query mc.thePlayer.motionX for example:
            [16:00:49] [Client thread/ERROR]: [ScriptAPI] Exception in module 'MMC Velocity'!
            jdk.nashorn.internal.runtime.ECMAException: TypeError: Cannot read property "motionX" from undefined
            at jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:57) ~[ECMAErrors.class:?]
            at jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:213) ~[ECMAErrors.class:?]
            at jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:185) ~[ECMAErrors.class:?]
            at jdk.nashorn.internal.runtime.ECMAErrors.typeError(ECMAErrors.java:172) ~[ECMAErrors.class:?]
            at jdk.nashorn.internal.runtime.Undefined.get(Undefined.java:157) ~[Undefined.class:?]
            at jdk.nashorn.internal.scripts.Script$Recompilation$23$293$^eval_.L:12#L:13(<eval>:14) ~[?:?]
            at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:637) ~[ScriptFunctionData.class:?]
            at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:494) ~[ScriptFunction.class:?]
            at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393) ~[ScriptRuntime.class:?]
            at jdk.nashorn.api.scripting.ScriptObjectMirror.call(ScriptObjectMirror.java:117) ~[ScriptObjectMirror.class:?]
            at net.ccbluex.liquidbounce.script.api.ScriptModule.callEvent(ScriptModule.kt:122) [ScriptModule.class:?]
            at net.ccbluex.liquidbounce.script.api.ScriptModule.callEvent$default(ScriptModule.kt:120) [ScriptModule.class:?]
            at net.ccbluex.liquidbounce.script.api.ScriptModule.onUpdate(ScriptModule.kt:62) [ScriptModule.class:?]
            at sun.reflect.GeneratedMethodAccessor115.invoke(Unknown Source) ~[?:?]
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51]
            at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51]
            at net.ccbluex.liquidbounce.event.EventManager.callEvent(EventManager.kt:53) [EventManager.class:?]
            at net.minecraft.client.entity.EntityPlayerSP.func_70636_d(EntityPlayerSP.java:1103) [bew.class:?]
            at net.minecraft.entity.EntityLivingBase.func_70071_h_(EntityLivingBase.java:1614) [pr.class:?]
            at net.minecraft.entity.player.EntityPlayer.func_70071_h_(EntityPlayer.java:283) [wn.class:?]
            at net.minecraft.client.entity.EntityPlayerSP.func_70071_h_(EntityPlayerSP.java:117) [bew.class:?]
            at net.minecraft.world.World.func_72866_a(World.java:1862) [adm.class:?]
            at net.minecraft.world.World.func_72870_g(World.java:1831) [adm.class:?]
            at net.minecraft.world.World.func_72939_s(World.java:1663) [adm.class:?]
            at net.minecraft.client.Minecraft.func_71407_l(Minecraft.java:2089) [ave.class:?]
            at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1024) [ave.class:?]
            at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:349) [ave.class:?]
            at net.minecraft.client.main.Main.main(SourceFile:124) [Main.class:?]
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51]
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51]
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51]
            at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51]
            at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
            at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]

            1 Reply Last reply
            0

            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