Comments (2)
TLDR: it depends.
Baritone has InputOverrideHandler
which has some capabilities to "press" WASD, space, shift and mouse buttons, but it doesn't behave exactly like physically pressing keys. Most notably it won't simulate clicks when not looking at a block because it was made for interacting with blocks.
If you want to place a block or interact with a block using InputOverrideHandler
is probably the easiest solution (it's on API, right?). There's also some helpers to look at things, but iirc those might be internal.
If you want to eat or otherwise use an item you should probably do the clicking yourself.
You definitely don't want PlayerController.click
. That's the function called the first tick you left click a block (i.e. instamine or start breaking). PlayerController.processRightClickBlock
/PlayerController.processRightClick
might be what you want.
from baritone.
@ZacSharp Right, after trying out a little bit yesterday I indeed find the InputOverrideHandler
to be the easiest and probably also the recommended solution.
So now i make the player look at the note block that needs to be right clicked and then call:
baritone.getInputOverrideHandler().setInputForceState(CLICK_RIGHT, true);
from baritone.
Related Issues (20)
- Slow Path Finding Issues with Baritone HOT 2
- Game keeps crashing after adding baritone HOT 8
- Neoforge crashs when pressing button start in minecraft launcher
- GUI
- Baritone Not Moving HOT 3
- Is there an example repo of fabricmc and baritoneapi for 1.20.4? HOT 2
- Baritone will not build schematics but will instead walk away HOT 2
- baritone crash on startup HOT 4
- Kill Please add a brief but descriptive title
- Switch to sword if a hostile mob is near HOT 2
- Probleme implementing Barione API in my 1.12.2 forge MOD
- I installed baratone and got a weird error HOT 1
- #Mine command not working properly HOT 4
- Baritone not working HOT 1
- #fill causes crash HOT 7
- cleararea not getting the entire area HOT 6
- [NeoForge] Deprecated mod file HOT 7
- Please add a brief but descriptive title
- Impossible to use elytra fly on nether's roof HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from baritone.