Zergatul / cheatutils

MIT License
33 stars 11 forks source link

Cannot fill glass bottle using block automation. #79

Open PotsThePotato opened 1 month ago

PotsThePotato commented 1 month ago
int WaterX = 1828;
int WaterY = -60;
int WaterZ = 497;

if (currentBlock.getX()==WaterX && currentBlock.getY()==WaterY && currentBlock.getZ()==WaterZ )
{
    blockAutomation.useItem("glass_bottle","from-top");
}

Glass bottle is selected in hand but it doesn't interact with the water block. Tried putting "minecraft:" before the ID, also tried without "from-top". Am I missing something?

Zergatul commented 1 month ago

Your code is ok. The problem is few items in Minecraft send another packets when you use them. And you are required to look at the block. Buckets/bottles are examples of such items.

You can verify if item can be used from block automation like this: don't look at target block, enter freecam, use item. If item use is not successful - it will not work from block automation.

As replacement you can use player.lookAt(...), keys.use.click()