Skip to content

Bot can't open chest (does hand animation but does not open chest) [Possible AC issue] #3036

@lupettohf

Description

@lupettohf
  • The FAQ doesn't contain a resolution to my issue

Versions

  • mineflayer: 4.8.1
  • server: works on paper (no plugins) 1.9.2, has issues on paper (constantiam.net) (possible no cheat plus?)
  • node: #.#.#

Detailed description of a problem

Bot need to open 5 chests (one on top of the other) and read content. This works with no issues on paper (without ac) but it's not working on a server with Nocheatplus.

Code is coming from https://github.com/lazydancer/idk/

What did you try yet?

  • Make the bot look at the chest before opening, adding delay.

Your current code

	async open(chest_type: types.ChestType, chest: number)  {
		if ( this.open_container != null ) {
			await this.bot.closeWindow(this.open_container)
			console.log("closing window")
		}

		await this.move(this.standing_location(chest_type, chest))
		const location = this.chest_to_location(chest_type, chest)
		console.log("Trying to open:" + location + " [" + chest +"]");
		this.bot.lookAt(location, true)
		await new Promise(resolve => setTimeout(resolve, 500));		
		this.open_container = await this.bot.openContainer(this.bot.blockAt(location))		
		await new Promise(resolve => setTimeout(resolve, 500));
		console.log("Done opening:" + location);
		return this.open_container.containerItems().map((o: any) => ({
			item: { 
				id: 0, 
				name: o.name, 
				metadata: o.metadata, 
				nbt: o.nbt, 
				display_name: o.displayName, 
				stack_size: o.stackSize,
			},
			location: { 
				chest_type, 
				chest: chest, 
				slot: o.slot, 
				shulker_slot: null,
			},
			count: o.count,
		}));

	}

Expected behavior

The bot should open the chest. This code works on a "vanilla" paper server on localhost but does not on a server with anticheat.
It has not issues opening the first two chests, with the third it just hangs.

Additional context

inventory 0
Trying to open:(1, 48, 2) [0]
Done opening:(1, 48, 2)
inventory 1
closing window
Trying to open:(1, 49, 2) [1]
Done opening:(1, 49, -2)
inventory 2
closing window
Trying to open:(1, 50, -2) [2]

The bot will hang here, so supposedly on await this.bot.openContainer(this.bot.blockAt(location))

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stage1just created by someone new to the project, we don't know yet if it deserves an implementation / a fpossible bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions