Minebotisamodforminecraftthattakescontroloftheplayerandautomaticallydoestasksforyou.Itsimulateskeyboardandmouseinputtointeractwiththeword.
Minebotiswrittentobeplayedonnormalminecraftinsurvivalmode.Creativemodeandsomemodspartiallyworkbutarenottargeted.
Thebotiscontrolledbygivingitcommandsusingthechatline.Foradvanceduses,itcanbecontrolledusingsimplescriptsortheJavascriptAPI.
HavealookattheGettingStartedWikiPagetoseehowtousethebot.
Thisrepoalsocontainsanindependentbowaiminghelper.
Download+Installing(Stableversion)InstallForgemodloader.
Getthelatestrelease.
ExtracttheZIPfileandputthejarfilesinyourminecraftmodsdirectory.
GettingHelpUsetheissuetrackerforbugsortogethelpwithyourstuff.I'mnotavailableintheminecraftforumanymore(it'sjusttoslowandblown-up).
Building(Latestversion)Thedeveloperversionmaycontainmorebugsthantherealversion.
BuildingMinebotisstraightforward.Youneedlinux,gitandthenormaljavadevelopmenttools.
Clone/DownloadthisrepoRun./release.shExtractthatZIPfileinyourminecraftmodsdirectoryIfyouencounterexceptionsduringthebuild,tryrunningthisintheminebotdirectory:./gradlew--no-daemonbuild
DevelopingMinebotIwon'tdevelopthismodanyfurther.Minecraft1.8.9isthelastsupportedversion.AbaiscbutincompleteportisavailableforMinecraft1.11.2.ButIwillbeacceptingPRstothisrepository.
Iuseeclipseneonfordevelopment.YoucansimplyimportMinebotasexistingproject.
==================Messagefrom1.16.3Porter(Vaccinate)=============SomekindoflawmessagesayingI'mnotresponsibleifyougetbannedforbottinganywhereetc.Notaccountableforanythingthatgoeswronghere,it'syourchoiceifyouchoosetousethecodeandalltheconsequencesofdoingso.IwasmainlyfocusedonMinebotandnotAimBow.Anotherpoint:Therearesomeslightmappingissueswithfunctions,dotakealookatdocumentationhttps://forge.yue.moe/javadoc/1.16.3/overview-summary.htmlhttps://gist.github.com/gigaherz/2dfa77c6efc7d1248ef88ec1920c0a93#file-1152to1161-xmlEspeciallyhelpfulfor1.16.3developmentlinks.
UsingIntelliJIDE&Gradle:Settingup:Ihavecommentedoutthemapsandthestatssections-Ididdeleteinsteadofcommentoutsomecode(Iknow,mybad)butifyoulookthroughthefirstcommitandctrl-Fformapandstatsyoushouldfindmostofthecalls.Step1:ClonetherepoStep2:OpentheprojectwithIntelliJStep3:InsideIntelliJ,Navigatetominebot/Minebot/src/build.gradleStep4:Rightclickitandselect"ImportGradleProject"Step5:Thatshouldopenasectionwiththegradleproject,Minebot,andalittleelephanttotheleftStep6:ExpandMinebot,Tasks,fg_runs,genIntelliJRuns.Step7:Doubleclick,itwillsetyourIntelliJuptobereadytorunMinecraftandimporttheprojectStep8:ExpandMinebot,Tasks,fg_runs,doubleclickrunClientStep9:WheninIntelliJ,SetupyourSDKtouseJava1.8(Ibelieveit'stheonlyoneworkingwithMinecraftatthegiventime)ThiswillrunthecodeandopenaMinecraftlauncherwiththisversionofMinecraftonit.Happydevelopment!
IfI'mgonewhenitcomestoimplementing1.17.xorfutureversions,essentially:Firstyouneedtoupgradethebuild.gradleandthemods.toml.ThesecanbefoundinMinebot/src/main/resources/META-INF.For1.16.3itwasimportantthatweupdatedthemods.tomltoincludealicense="x"portionformodstorun.IassumeditwasGNUbasedonMichael'scomments.Whenyou'rehere,increaseloaderVersion="[xx,)"tothevalidonefortheversion.Ifyou'renotsure,findsomeothermod'sgithubandcheckwhatthey'reusingfortheversionyou'retryingtoportto.
Then,you'llneedtoupdatethebuild.gradle-onceagainseewhatothermoddersusehere,butlookformappingschannel:'snapshot',version:'xxxx'foryourversionandthenthedependencies{minecraft'...'}needsyourforgeversioninit.
Now,youcan"Reimportallgradleprojects"inyourIntelliJGradlewindow(Abovethelittleelephant)
Iftherearemanyerrors,unlucky.Gothrougheachonebyone-ifit'safaultimport,lookforthenewmappinginthedocumentationforyourversion.SeeoneofthelinkstoknowwhatI'mtalkingabout.Then,onebyone,replaceallreferencestoit.Goodluck&Happycoding,
Vaccinate04/11/2020=====================EndMessagefrom1.16.3Porter=========================ThemainclassesofMinebothavesomeJavadocinthem.Mostotherclassesareundocumentedbutshouldexplainthemselves.
Howtoaddanewcommand:
AddanewcommandclassandregisteritinAIChatController.TheclassneedsanAICommand-Annotation.Mostcommandsuse"minebot"asbasecmmand.AtatleastonemethodwithanAICommandInvocation-Annotation.Addparameterstothatmethod.EachparameterneedsaAICommandParameter-Annotationthatisusedtogeneratethehelptextandtabcompletion.Itcanhaveanysupportedtype(int,enums,color,block,...)butshouldnotallowambigiouscommandlines.Implementthatmethod.Youcaneitherimplementastrategythatshouldnowbeusedordothestuffdirectlyinthemethod.Howtoimplementanewstrategy:
LetanewclassextendTaskStrategyImplementthesearchtaskmethod.ItshouldsearchnewstufftodoandsendthetaskstothepassedAIHelpercallingit'saddTaskmethod.Ifitdoesnotsendanytasks,itisfinished.Mindthat,duetoserverlagsorotherproblems,thesearchmethodmightbecalledbeforeallpreviouslyassignedtaskshavebeenworkedon.Youshouldhandlethis.Howtoimplementanewsearchingstrategy(thefastway)
ExtendMovePathfinder.Lookattheotherexamplesonhowtodoit,basicallyyoujusthavetorateeachdestinationandcanaddataskthatshouldbedonewhenadestinationisreached.Alwaysworkonthelocalworldobjectwhenpathfinding.Thisallowsthebottopre-searchtaskswhileitisstillworkingontheoldones.Howtoimplementanewtask:
LetaClassextendanAITaskAddaisFinishedmethodthatreturnstrueifthetaskisdone.AddarunTickmethod,thatiscalledeverytickandshouldworktowardsthegoal.YouwillfindalotofhelpfulmethodsintheAIHelper.Therearemanyoptionalmethods.HavealookattheAITaskdocumentation.
评论