Support use left hand

This commit is contained in:
BruceChen 2022-09-12 02:19:20 +08:00
parent effb3050b4
commit ccb8610020
5 changed files with 24 additions and 1 deletions

View file

@ -188,7 +188,10 @@ namespace MinecraftClient.ChatBots
private void UseFishRod()
{
UseItemInHand();
if (Settings.AutoFishing_Mainhand)
UseItemInHand();
else
UseItemInLeftHand();
}
/// <summary>

View file

@ -1277,6 +1277,15 @@ namespace MinecraftClient
return InvokeOnMainThread(() => handler.SendUseItem(0, this.sequenceId));
}
/// <summary>
/// Use the item currently in the player's left hand
/// </summary>
/// <returns>TRUE if the item was successfully used</returns>
public bool UseItemOnLeftHand()
{
return InvokeOnMainThread(() => handler.SendUseItem(1, this.sequenceId));
}
/// <summary>
/// Try to merge a slot
/// </summary>

View file

@ -207,6 +207,7 @@ interaction=Attack # Possible values: Interact, Attack (default)
# /!\ Make sure server rules allow automated farming before using this bot
enabled=false
antidespawn=false
main_hand=true # Use the main hand or the second hand to hold the rod
fishing_delay=3.0 # How long after entering the game to start fishing (seconds).
fishing_timeout=600.0 # Fishing timeout (seconds). Timeout will re-cast the rod
fishing_hook_threshold=0.2 # Fish hooks moving on the Y-axis above this threshold will be considered to have caught a fish.

View file

@ -1262,6 +1262,15 @@ namespace MinecraftClient
return Handler.UseItemOnHand();
}
/// <summary>
/// Use item currently in the player's hand (active inventory bar slot)
/// </summary>
/// <returns>TRUE if successful</returns>
protected bool UseItemInLeftHand()
{
return Handler.UseItemOnLeftHand();
}
/// <summary>
/// Check inventory handling enable status
/// </summary>

View file

@ -203,6 +203,7 @@ namespace MinecraftClient
//Auto Fishing
public static bool AutoFishing_Enabled = false;
public static bool AutoFishing_Antidespawn = false;
public static bool AutoFishing_Mainhand = true;
public static double AutoFishing_FishingDelay = 3.0;
public static double AutoFishing_FishingTimeout = 600.0;
public static double AutoFishing_FishingHookThreshold = 0.2;