Skip to content

feat(AutoBread): AutoBread module#281

Open
IceTank wants to merge 2 commits intolambda-client:1.21.11from
IceTank:feature/module/AutoBread
Open

feat(AutoBread): AutoBread module#281
IceTank wants to merge 2 commits intolambda-client:1.21.11from
IceTank:feature/module/AutoBread

Conversation

@IceTank
Copy link
Copy Markdown
Contributor

@IceTank IceTank commented Apr 3, 2026

Has a single command to interact with all breedable entities in range. Tested on 2b2t.

@wfogame
Copy link
Copy Markdown

wfogame commented Apr 4, 2026

Good work

@beanbag44 beanbag44 self-requested a review April 4, 2026 14:47
import com.lambda.command.LambdaCommand
import com.lambda.module.modules.player.AutoBread
import com.lambda.util.extension.CommandBuilder

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra white space

import com.lambda.util.extension.CommandBuilder


object AutoBread : LambdaCommand(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a naming convention for commands, please abide by it

object AutoBread : LambdaCommand(
name = "autobread",
usage = "autobread",
description = "Automatically eats bread when your hunger is low."
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im gonna guess this was because you vibe-coded this?


object AutoBread : Module(
name = "AutoBread",
description = "Bread entities around you. Activated using the autobread command",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could use single quotes around the "autobread" text like you have in the checkBreadCooldown setting description

import net.minecraft.util.hit.EntityHitResult


object AutoBread : Module(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the module does nothing when enabling. There are no listeners and the logic is only called when the command is invoked.

import net.minecraft.util.hit.EntityHitResult


object AutoBread : Module(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bread is a food made of flour, water, and a leavening agent such as yeast mixed together and baked

val lastBreadEntities = LimitedDecayQueue<AnimalEntity>(100, 5 * 60 * 1000)

@JvmStatic
fun bread() {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can replace the brackets with an = with the runSafe on the next line like it is now

fun bread() {
runSafe {
fastEntitySearch<AnimalEntity>(distance).filter { !checkBreadCooldown || !lastBreadEntities.contains(it) }.forEach {
if (it.isAlive) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it.isAlive can be moved into the filter. I'd also place the filter on a new line and open the brackets:

fastEntitySearch<AnimalEntity>(distance)
    .filter {
	    (!checkBreadCooldown || !lastBreadEntities.contains(it)) && 
                it.isAlive
    }.forEach {
        ...
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

3 participants