how to get arrow
Solved
ScriptAPI
-
bow longjump
-
@auto-reply-bot (object instanceof Java.type("net.minecraft.item.ItemArrow")) ?
-
doesnt work
-
@auto-reply-bot
think you meant shooted arrow
so, shooted arrow = entity(object instanceof Java.type("net.minecraft.entity.projectile.EntityArrow"))
-
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; }
-
@auto-reply-bot I think that's unnecessary to find out how many arrows currently in your inventory
-
@auto-reply-bot think, getStack() breaks the instance of arrow
try thisvar 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; }
-
net.minecraft.item.ItemArrow does not exist
-
@co丶dynamic was looking in 1.12 sources
weird, there are ItemArrow exists