CCBlueX Forum

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

    Solved how to get arrow

    ScriptAPI
    5
    13
    101
    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.
    • DreamWasFucked
      DreamWasFucked Banned last edited by DreamWasFucked

      i tried getting arrow with

      Item.getItemById(262), net.minecraft.item.ItemArrow
      

      but it doesnt work
      how pls help

      dntdbt 1 Reply Last reply Reply Quote 0
      • Q
        quadro last edited by quadro

        net.minecraft.init.Items -> public static final Item arrow
        recommended reading: minecraft source code

        edit: also accomplishable by checking unlocalized item name

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

          what are you trying to do

          DreamWasFucked 1 Reply Last reply Reply Quote 0
          • DreamWasFucked
            DreamWasFucked Banned @Guest last edited by

            bow longjump

            1 Reply Last reply Reply Quote 0
            • dntdbt
              dntdbt @DreamWasFucked last edited by

              @auto-reply-bot (object instanceof Java.type("net.minecraft.item.ItemArrow")) ?

              DreamWasFucked 1 Reply Last reply Reply Quote 0
              • DreamWasFucked
                DreamWasFucked Banned @dntdbt last edited by

                doesnt work

                dntdbt 1 Reply Last reply Reply Quote 0
                • dntdbt
                  dntdbt @DreamWasFucked last edited by

                  @auto-reply-bot
                  think you meant shooted arrow
                  so, shooted arrow = entity

                  (object instanceof Java.type("net.minecraft.entity.projectile.EntityArrow"))

                  DreamWasFucked 1 Reply Last reply Reply Quote 0
                  • DreamWasFucked
                    DreamWasFucked Banned @dntdbt last edited by DreamWasFucked

                    i mean i need to get how many arrows in the inventory

                    like this:

                    function getArrowsAmount() {
                        var amount = 0;
                        for(i = 9; i < 45; ++i) {
                            stack = mc.thePlayer.inventoryContainer.getSlot(i).getStack();
                            if (stack != null && stack instanceof Arrow) {
                                amount += stack.stackSize;
                            }
                        }
                        return amount;
                    }
                    
                    C dntdbt 2 Replies Last reply Reply Quote 0
                    • C
                      Co丶Dynamic @DreamWasFucked last edited by

                      @auto-reply-bot I think that's unnecessary to find out how many arrows currently in your inventory

                      1 Reply Last reply Reply Quote 0
                      • dntdbt
                        dntdbt @DreamWasFucked last edited by dntdbt

                        @auto-reply-bot think, getStack() breaks the instance of arrow
                        try this

                        var Arrow = Java.type("net.minecraft.item.ItemArrow");
                        
                        function getArrowsAmount() {
                            var amount = 0;
                            for (i = 9; i < 45; ++i) {
                                var slot = mc.thePlayer.intentoryContainer.getSlot(i);
                                if (slot != null && slot instanceof Arrow) {
                                    amount += slot.stack.stackSize;
                                }
                            }
                            return amount;
                        }
                        
                        C 1 Reply Last reply Reply Quote 0
                        • C
                          Co丶Dynamic @dntdbt last edited by

                          @dntdbt 捕获.PNG
                          that's strange
                          no ItemArrow at all

                          dntdbt 1 Reply Last reply Reply Quote 0
                          • DreamWasFucked
                            DreamWasFucked Banned last edited by

                            net.minecraft.item.ItemArrow does not exist

                            1 Reply Last reply Reply Quote 0
                            • dntdbt
                              dntdbt @Co丶Dynamic last edited by dntdbt

                              @co丶dynamic was looking in 1.12 sources
                              weird, there are ItemArrow exists

                              1 Reply Last reply Reply Quote 0
                              • Q
                                quadro last edited by quadro

                                net.minecraft.init.Items -> public static final Item arrow
                                recommended reading: minecraft source code

                                edit: also accomplishable by checking unlocalized item name

                                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