Topic category: Help with Minecraft modding (Java Edition)
I want to have my mob collect wood and build a campfire. I put "Break block of type [all wood] speed [0.5] max detection height [64] conditions [infinite]" so it will collect wood. I also said that it has 9 inventory slots and 64 max items per slot. I didn't bind it to a GUI. Then, I put this script in a separate procedure and set it to work on entity tick update:
if (((entity instanceof PlayerEntity) ? ((PlayerEntity) entity).inventory.hasItemStack(new ItemStack(Blocks.OAK_LOG, (int) (1))) : false)) {
world.setBlockState(new BlockPos((int) (entity.getPosX()), (int) (entity.getPosY()), (int) (entity.getPosZ())),
Blocks.CAMPFIRE.getDefaultState(), 3);
Why isn't it working?
The image is not loading
The code above the image is what the image showed