CCBlueX Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    Help me how to convert?

    ScriptAPI
    6
    5
    276
    Loading More Posts
    • 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.
    • ButterChicken
      ButterChicken last edited by

      C0FPacketConfirmTransaction packetConfirmTransaction = (C0FPacketConfirmTransaction)event.getPacket();
      

      From the above code, how to modify it into javascript code?

      Painis Bot 1 Reply Last reply Reply Quote 0
      • As丶One
        As丶One last edited by As丶One

        var C0FPacketConfirmTransaction = Java.type("net.minecraft.network.play.client.C0FPacketConfirmTransaction")
        module.on("packet",function(event){
                if(event.getPacket() instanceof C0FPacketConfirmTransaction){
                    var packetConfirmTransaction = event.getPacket()
                    //your codes
                }
        })
        
        1 Reply Last reply Reply Quote 1
        • C
          commandblock2 last edited by

          just remove the type C0FPacketConfirmTransaction then. Since JavaScript is a dynamically typed language, the type is determined at runtime. If the packet is a instance of a C0FPacketConfirmTransaction you can call getWindowId() and getUid() then if it is not, exceptions should be thrown.

          //if (event.getPacket() instanceof C0FPacketConfirmTransaction)
              packetConfirmTransaction = event.getPacket();
          
          1 Reply Last reply Reply Quote 2
          • Painis Bot
            Painis Bot Banned @ButterChicken last edited by

            This post is deleted!
            1 Reply Last reply Reply Quote 0
            • skiddermaster412
              skiddermaster412 Banned last edited by

              This post is deleted!
              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              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