Skip to content

feat(AutoMount): Add AutoMount module#240

Open
IceTank wants to merge 6 commits intolambda-client:1.21.11from
IceTank:feature/module/automount
Open

feat(AutoMount): Add AutoMount module#240
IceTank wants to merge 6 commits intolambda-client:1.21.11from
IceTank:feature/module/automount

Conversation

@IceTank
Copy link
Contributor

@IceTank IceTank commented Feb 2, 2026

Add AutoMount module to automatically mount or remount entities

@IceTank
Copy link
Contributor Author

IceTank commented Feb 2, 2026

Not tested yet

@IceTank
Copy link
Contributor Author

IceTank commented Feb 3, 2026

Works now

@IceTank IceTank marked this pull request as ready for review February 3, 2026 21:02
@beanbag44 beanbag44 self-requested a review February 22, 2026 10:36
@beanbag44
Copy link
Member

oh yeah, also use connection inside of SafeContext rather than mc.networkHandler

@IceTank IceTank requested a review from beanbag44 March 7, 2026 15:30
@github-project-automation github-project-automation bot moved this to Backlog in Kanban Mar 11, 2026
transitive-accessible class net/minecraft/screen/slot/ArmorSlot
transitive-accessible field net/minecraft/screen/slot/ArmorSlot equipmentSlot Lnet/minecraft/entity/EquipmentSlot;
transitive-accessible field net/minecraft/entity/Entity FLAGS Lnet/minecraft/entity/data/TrackedData;
accessible method net/minecraft/entity/Entity canAddPassenger (Lnet/minecraft/entity/Entity;)Z
Copy link
Member

Choose a reason for hiding this comment

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

add transitive- at the beginning

var lastEntity: Entity? = null

init {
setDefaultAutomationConfig("AutoMount")
Copy link
Member

Choose a reason for hiding this comment

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

best to hide unused configs in the automation config

) {
var autoRemount by setting("Auto Remount", false, description = "Automatically remounts if you get off")
var autoMountEntities by setting("Auto Mount Entities", true, description = "Automatically mounts nearby entities in range")
var autoMountEntityList by setting("Auto Mount Entity List", mutableListOf(), Registries.ENTITY_TYPE.toList()) { autoMountEntities }
Copy link
Member

Choose a reason for hiding this comment

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

we have an entity selection settings group now which you could use and modify the default selected

var hit: VisibilityChecker.CheckedHit? = null
rotationRequest {
hit = lookAtEntity(entity)
}.submit()
Copy link
Member

Choose a reason for hiding this comment

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

no check for if the rotation is done

runSafeAutomated {
var hit: VisibilityChecker.CheckedHit? = null
rotationRequest {
hit = lookAtEntity(entity)
Copy link
Member

Choose a reason for hiding this comment

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

this doesnt actually set the rotation in the request. Best to set the hit value before the request, then set the rotation in the request

}
}

private fun SafeContext.interactEntity(entity: Entity) {
Copy link
Member

Choose a reason for hiding this comment

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

could make the whole function AutomatedSafeContext rather than SafeContext as one of the call sites already has an automated safe context and it would cut down on an extra indent

}
} else {
connection.sendPacket(PlayerInteractEntityC2SPacket.interactAt(entity, false, Hand.MAIN_HAND, Vec3d(0.5, 0.5, 0.5)))
connection.sendPacket(PlayerInteractEntityC2SPacket.interact(entity, false, Hand.MAIN_HAND))
Copy link
Member

Choose a reason for hiding this comment

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

isnt this only sent if the first one isnt successful in vanilla mc?

}.submit()
hit?.let {
val hitResult = it.hit as? EntityHitResult ?: return@let
interaction.interactEntityAtLocation(player, entity, hitResult, Hand.MAIN_HAND)
Copy link
Member

Choose a reason for hiding this comment

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

this doesnt have the player sneaking override to set it to false

return@let
}
if (canRide(it)) {
intervalTimer.reset()
Copy link
Member

Choose a reason for hiding this comment

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

could prob put this at the start of interactEntity as its called before every invocation

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.

2 participants