Navigation

    CCBlueX Forum

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

    How to get the item the player is holding?

    Scripts
    4
    8
    98
    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.
    • chodeman
      chodeman last edited by

      module.on("update", function() {
         //if held item = map (
         //  commandManager.executeCommands(".toggle trigger off")
         //)
         //
      })
      
      CzechHek I 2 Replies Last reply Reply Quote 0
      • CzechHek
        CzechHek @chodeman last edited by

        @vol1n mc.thePlayer.getHeldItem()

        chodeman 1 Reply Last reply Reply Quote 0
        • chodeman
          chodeman @CzechHek last edited by

          @czechhek What does the getHeldItem() function return?

          1 Reply Last reply Reply Quote 0
          • I
            idk my name @chodeman last edited by

            @vol1n if (mc.thePlayer.getHeldItem().getItem() instanceof ItemMap) {}

            chodeman 2 Replies Last reply Reply Quote 0
            • chodeman
              chodeman @idk my name last edited by

              @idk-my-name

                  module.on("update", function() {
                      if (mc.thePlayer.getHeldItem().getItem() instanceof ItemMap) {
                          commandManager.executeCommands(".toggle trigger off")
                      }    
                  })
              

              Any idea why this didn't work?

              I 1 Reply Last reply Reply Quote 0
              • chodeman
                chodeman @idk my name last edited by

                @idk-my-name Also, is there any documentation on the mc.thePlayer class?

                1 Reply Last reply Reply Quote 0
                • allah gaming
                  allah gaming last edited by

                  scriptapi.liquidbounce.net

                  1 Reply Last reply Reply Quote 0
                  • I
                    idk my name @chodeman last edited by

                    @chodeman executeCommand without s at the end

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post
                    Powered by NodeBB | Contributors