-
Notifications
You must be signed in to change notification settings - Fork 401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement right click on blocks #397
Comments
Hi, As you could see, the single command mode is very limited as it will only send text to the server, and you can't chain commands. Moreover, internal commands are not processed so "/script" is sent as a server command instead. So the ScriptScheduler approach is indeed the best way of doing this. In txt scripts, the The Indeed, the Feel free to ask if anything is still unclear. |
is there anyway of making a script so that the alt can right click blocks? |
Interacting with the terrain is currently not implemented. It is only possible to read the terrain and move around.
|
Alright thanks do you think this would ever be added? |
I don't have time for that myself, so no unless a motivated contributor appears (I can provide guidance). |
@ORelio im a python dev with a little background in c#. but i dont know about minecraft packets and encryption. |
|
Hi, If I'm correct, Minecraft implement "Block entities". For instance, a block entity is associated to a lever or button. You need to interact with the block entity in order to activate the button. In order to do that, you would need to handle entities as a prerequisite. See entity-related packets in the wiki: https://wiki.vg/Protocol#Clientbound_2 - I'm not 100% sure of that. @Pokechu22 could you confirm this? However to click on block, I think it's a Player Block Placement. This old wiki page states that the client sends one of these packets any time a right-click is issued on a surface. Please note that the player must be within 4 blocks of the clicked block/entity and actively look at the target in order to pass anti-cheat plugin checks. So you also need to send Player Position and Look before clicking. |
You've got a misunderstanding about what block entities are; they're separate from regular entities and have their own set of packets. Things like furnaces and chests have block entities, but buttons don't; only the interact packet should be needed for them. EDIT: however, note that buttons might be a bit more complicated just because of their small hitbox which I think might cause weird behavior if you aren't clicking on the right part of the block. If you want a simple block that has a reaction when you click it, you can try redstone ore since it gives off light and triggers a block update (detectable with an observer) when clicked. That'd be useful for basic testing at least. (See the wiki article, and also, note that they used to be called "tile entities" in the rather distant past) |
Thank for replying and clearing some confusion guys! It was easier for me to handle incoming types as I had a clear example of what needed to be done; however, I'm stuck on how I would handle / send the Player Block Placement packet since its an outgoing type. For example, the KeepAlive packet you essentially sending it after you receive it? What would be the steps on handling the player block placement generally a packetoutgoingtype. Also, communicating via discord would be easier for me if you can. Penguin#0001 |
Thanks for clarifying, @Pokechu22 😉 |
Hey, so I figured out on how to SendPackets but I'm struggling on converting some of the data to bytes. This is what I have so far, I'm not sure how I would convert the other fields like Face, Hand, Cursor Position |
The link doesn't seem to load for me, so I can't directly review your code. However, for Face and Hand, both fields are a VarInt enum, which you basically just write as a VarInt (so 0/1 for hand where 0 is main hand and 1 is off hand, and the 3rd table here for face). I don't remember off hand if there's already a way to write a float in MCC. |
public bool SendBlockPlace(Location location)
{
if(Settings.TerrainAndMovements)
{
PacketOutgoingType packetType = PacketOutgoingType.PlayerBlockPlacement;
try
{
SendPacket(packetType, concatBytes(getDouble(location.X), getDouble(location.Y), getDouble(location.Z)));
return true;
}
catch(SocketException) { return false; }
}
else return false;
} This was what I had written down so far... Thanks for clarifying somethings for me as well. |
Hi,
|
@xPenguinx You have discord? I would like to talk to you. Mine: Christo4g#0466. Ty |
Should be implemented now. See also: #183 |
Hello,
I was doing some reading on trying to execute multiple commands at the end of a bat or shell script using
"/script file"
. However, the script is sent before it can fully login and then you get disconnected. I tried addingwait 30
and this doesn't seem to work.Sample Bat File:
I'd like to use the same
MinecraftClient.ini
for all accounts. So, if there any changes this could be made easily instead of writing ased command
or something.Script Output:
I removed the server I was connecting too.
Sample file.txt:
I've already tried appending a
/
and/send
before the commands. No difference.After doing some additional reading. I successfully able to complete my task using
Task Scheduler
.tasks.ini
tasks.txt
The first issue I'm having is since this is running in
tasks
you cannot use thewait
command. Therefore, as a solution, I had tomove west
multiple times to allow the/visit name
command finish teleporting and then it would find the proper/warp name
. Otherwise, it would say warp doesn't exist. :(The second issue is I'd have to have multiple
MinecraftClient.ini
files to define multipletasks.ini
files to define multipletasks.txt
files to modifying all the bat or shell script files to support the newMinecraftClient.ini
file.I know in the
tasks.ini
you can have multiple triggers. But, I don't see a way to make it defined by an account. Doing it this would basically teleport them from one warp to another.tasks.ini
Kind Regards,
Cory
TESTED: Lastest Dev Build
The text was updated successfully, but these errors were encountered: