CCBlueX Forum

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

    onPlaceBlock , onSendPacket event

    ScriptAPI
    7
    13
    503
    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.
    • ChocoPie_isme
      ChocoPie_isme Banned last edited by

      the title says it all

      1 Reply Last reply Reply Quote 0
      • Azure
        Azure last edited by

        watchu want?

        1 Reply Last reply Reply Quote 0
        • Senk Ju
          Senk Ju Admin last edited by

          Why would you need a onPacketSend event? Packet names either start with a C or an S. Packets whose name begins with a C are client packets, those that begin with an S are server packets.

          ChocoPie_isme 1 Reply Last reply Reply Quote 0
          • ChocoPie_isme
            ChocoPie_isme Banned @Senk Ju last edited by

            @Senk-Ju said in onPlaceBlock , onSendPacket event:

            Why would you need a onPacketSend event? Packet names either start with a C or an S. Packets whose name begins with a C are client packets, those that begin with an S are server packets.

            i mean i want to execute sth when sending a packet, example:

            this.onSendPacket = function(event) {
                  if(event.sendPacket() instanceof C03PacketPlayer) {
                 Chat.print("you send a c03 packet!")
                  }
            }
            
            infAura 1 Reply Last reply Reply Quote 0
            • Azure
              Azure last edited by

              learn english, kid. You used send....

              1 Reply Last reply Reply Quote 0
              • Senk Ju
                Senk Ju Admin last edited by

                Why not do it like this?

                module.on("packet", function(event) {
                    var packet = event.getPacket();
                
                    if (packet instanceof Java.type("net.minecraft.network.play.client.C03PacketPlayer")) {
                        Chat.print("you send a c03 packet!");   
                    }
                });
                
                ChocoPie_isme 1 Reply Last reply Reply Quote 0
                • infAura
                  infAura @ChocoPie_isme last edited by

                  @ChocoPie_isme rip brian cels v2
                  now i don even hvae brian cels enough to tyoep pwoperly 😞

                  1 Reply Last reply Reply Quote 0
                  • ChocoPie_isme
                    ChocoPie_isme Banned @Senk Ju last edited by

                    @Senk-Ju said in onPlaceBlock , onSendPacket event:

                    Why not do it like this?

                    module.on("packet", function(event) {
                        var packet = event.getPacket();
                    
                        if (packet instanceof Java.type("net.minecraft.network.play.client.C03PacketPlayer")) {
                            Chat.print("you send a c03 packet!");   
                        }
                    });
                    

                    i thought the code will be execute when i RECEIVE (not send) a packet?

                    LolMC 1 Reply Last reply Reply Quote 0
                    • Senk Ju
                      Senk Ju Admin last edited by

                      In the documentation it says the following:

                      Event Name Has event data? Description
                      packet Yes Called every time a packet is processed.

                      Packet event

                      Method Description Type
                      eventData.getPacket() Returns the packet which triggered this event. Packet
                      event.cancelEvent() Cancels the event. void
                      Example:
                      var C00Handshake = Java.type("net.minecraft.network.handshake.client.C00Handshake");
                      
                      ...
                      
                      module.on("packet", function(eventData) {
                          var packet = eventData.getPacket();
                      
                          if (packet instanceof C00Handshake) {
                              Chat.print("Cancelling handshake.");
                              eventData.cancelEvent();
                          }
                      });
                      
                      ? 1 Reply Last reply Reply Quote 0
                      • LolMC
                        LolMC @ChocoPie_isme last edited by

                        This post is deleted!
                        1 Reply Last reply Reply Quote 0
                        • ?
                          A Former User @Senk Ju last edited by

                          @Senk-Ju
                          My Opinion:
                          CxxPacket only sends by Client and won't receive from Server
                          SxxPacket only receives from Server

                          1 Reply Last reply Reply Quote 0
                          • ?
                            A Former User last edited by

                            As for "onPlaceBlock", I think you can check C08PacketPlayerBlockPlacement in onPacket.
                            (I don't code with mcp918 so If it's wrong way plz remind me, thanks)

                            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