mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Add CobblestoneMiner and TreeFarmer by Nekiplay (#1047)
This commit is contained in:
parent
fa0f91aad8
commit
ee96788019
2 changed files with 101 additions and 0 deletions
37
MinecraftClient/config/ChatBots/CobblestoneMiner.cs
Normal file
37
MinecraftClient/config/ChatBots/CobblestoneMiner.cs
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
//MCCScript 1.0
|
||||
|
||||
MCC.LoadBot(new CobblestoneMiner());
|
||||
|
||||
//MCCScript Extensions
|
||||
|
||||
public class CobblestoneMiner: ChatBot
|
||||
{
|
||||
// === CONFIG - REPLACE COBBLESTONE LOCATION x y z VALUES HERE ===
|
||||
// You need to stand in front of the cobblestone block to mine
|
||||
// Also make sure the Cobblestone will regenerate e.g. using water and lava
|
||||
Location cobblestone = new Location(x, y, z);
|
||||
// === END OF CONFIG ===
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
LogToConsole("Bot enabled!");
|
||||
}
|
||||
|
||||
public override void Update()
|
||||
{
|
||||
Material blockType = GetWorld().GetBlock(cobblestone).Type;
|
||||
switch (blockType)
|
||||
{
|
||||
case Material.Stone:
|
||||
PlayerDigging(0, cobblestone, 1);
|
||||
Thread.Sleep(100);
|
||||
PlayerDigging(2, cobblestone, 1);
|
||||
break;
|
||||
case Material.Cobblestone:
|
||||
PlayerDigging(0, cobblestone, 1);
|
||||
Thread.Sleep(100);
|
||||
PlayerDigging(2, cobblestone, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
64
MinecraftClient/config/ChatBots/TreeFarmer.cs
Normal file
64
MinecraftClient/config/ChatBots/TreeFarmer.cs
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
//MCCScript 1.0
|
||||
|
||||
MCC.LoadBot(new TreeFarmer());
|
||||
|
||||
//MCCScript Extensions
|
||||
|
||||
public class TreeFarmer : ChatBot
|
||||
{
|
||||
// You need to stand in front of the sapling and put items in your inventory hotbar:
|
||||
// - First slot on the left (Slot 0): Axe for digging the tree
|
||||
// - Second slot on the left (Slot 1): Sapling stack for planting the tree
|
||||
// Then set sapling location below, login with MCC and load this script
|
||||
|
||||
// === CONFIG - REPLACE SAPLING LOCATION x y z VALUES HERE ===
|
||||
Location sapling = new Location(x, y, z);
|
||||
// === END OF CONFIG ===
|
||||
|
||||
public override void Update()
|
||||
{
|
||||
Material blockType = GetWorld().GetBlock(sapling).Type;
|
||||
switch (blockType)
|
||||
{
|
||||
case Material.OakSapling:
|
||||
// Still a sapling, nothing to do
|
||||
break;
|
||||
case Material.OakLog:
|
||||
// Tree has grown, dig 4 blocks
|
||||
ChangeSlot(0);
|
||||
PlayerDigging(0, sapling, 1);
|
||||
Thread.Sleep(100);
|
||||
PlayerDigging(2, sapling, 1);
|
||||
// 1
|
||||
PlayerDigging(0, new Location(sapling.X, sapling.Y + 1, sapling.Z), 1);
|
||||
Thread.Sleep(100);
|
||||
PlayerDigging(2, new Location(sapling.X, sapling.Y + 1, sapling.Z), 1);
|
||||
// 2
|
||||
PlayerDigging(0, new Location(sapling.X, sapling.Y + 2, sapling.Z), 1);
|
||||
Thread.Sleep(100);
|
||||
PlayerDigging(2, new Location(sapling.X, sapling.Y + 2, sapling.Z), 1);
|
||||
// 3
|
||||
PlayerDigging(0, new Location(sapling.X, sapling.Y + 3, sapling.Z), 1);
|
||||
Thread.Sleep(100);
|
||||
PlayerDigging(2, new Location(sapling.X, sapling.Y + 3, sapling.Z), 1);
|
||||
// 4
|
||||
PlayerDigging(0, new Location(sapling.X, sapling.Y + 4, sapling.Z), 1);
|
||||
Thread.Sleep(100);
|
||||
PlayerDigging(2, new Location(sapling.X, sapling.Y + 4, sapling.Z), 1);
|
||||
break;
|
||||
case Material.Air:
|
||||
// No tree, plant something
|
||||
ChangeSlot(1);
|
||||
SendPlaceBlock(sapling);
|
||||
break;
|
||||
default:
|
||||
// Other block, cannot grow trees here
|
||||
LogToConsole("Block at " + sapling + " is not a sapling: " + blockType + "...");
|
||||
break;
|
||||
}
|
||||
}
|
||||
public override void Initialize()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue