Jump to content

Creating a bot


Gingerbreadman

Recommended Posts

hello everyone and I need help to create a grass bot

this bot has to automatically place dirt in selected blocks, and when they turn into grass harvest them automatically, it will also have to be able to use commands like /tell

though I need help doing this, as I am not familiar with the forge api

Link to comment
Share on other sites

Should bot be a static block (machine) that operates on some block (around or below or facing for example) or should it be a living entity that walks around and does bot stuff?

 

You will either go with TileEntity (for block-machine).

or custom entity, where you will certainly want to look at how sheep eats grass (they actually find grass and set it to dirt - eating it).

1.7.10 is no longer supported by forge, you are on your own.

Link to comment
Share on other sites

And if it is an entity you'll definitely need to start programming custom AIs for your entity to run on. Like Ernio said look into the sheep class to see how they locate and change grass.

Creator of the MyFit, MagiCraft, Tesseract gun, and Papa's Wingeria mod.

Link to comment
Share on other sites

Like Asweez points out, that is basically a type of hacking (assuming you create a bot that is better than a human).

 

It also would be a tough programming exercise.  Are you an experienced modder and Java programmer.  I think you'd have to create an AI and pathfinding system and then you'd have to intercept all the user input or at least generate user input that achieves what you want.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

Well, I'm not entirely sure what the person wants, but if he wants the player to be able to change to an automated state, then he either needs a transforming command to make the player into a separate entity, or a piece of code that directly 'hacks' into the players buttons and causes them to be physically pressed in a certain manner. I lean towards the first as the second one is easily replicable with programs you can make separately. The second one is somewhat simple though. Just make a basic player, but replace the keyboard functions with repeating timers. I'm afraid I can't actually help you do this, though, as I am not fully aware how to mod the player entity.

Link to comment
Share on other sites

I lean towards the first as the second one is easily replicable with programs you can make separately.

 

No, you wouldn't want a separate bot program for this because it would need too much "vision processing" to figure what to do.  Separate bots work well for games like Runescape where there is a fixed map (everything is in a known location), resources regenerate in the exact same place and the colors are set (they don't change with lighting and such) so you can look for particular pixel colors and assume what is there.  To try to prevent bots in Runescape the game developers actively disrupt repetitive tasks with random mini games, although they too can be accomplished with a bot.

 

In Minecraft you would need the bot to be in-game so it could find the block to be mined or whatever.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

I lean towards the first as the second one is easily replicable with programs you can make separately.

 

No, you wouldn't want a separate bot program for this because it would need too much "vision processing" to figure what to do.  Separate bots work well for things like Runescape where there is a fixed map (everything is in a known location) and the colors are set (they don't change with lighting and such) so you can look for particular pixel colors and assume what is there.  In Minecraft you would need the bot to be in-game so it could find the block to be mined or whatever.

 

I assume that he just wants a repeating button masher, correct?

Link to comment
Share on other sites

I assume that he just wants a repeating button masher, correct?

 

That wouldn't be very useful in Minecraft (unlike games like Runescape).  According to the poster, the bot is supposed to plant things and then harvest them.  I assume he'd want more than one plant going.  So it would have to be aware of where it can plant, know how to check back for harvesting, etc.

 

Also, when someone asks a question like this you know their next question will be: now how do I make a bot that can fight zombies, etc.

 

But yes, if it were just button mashing he could do that simply with separate program.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I create my mod pack,yesterday my mod pack is fine but i add one mod and error. I'm delete this mmod but minecraft is still stop on CONFIG_LOAD then I tried to delete config and restart it but again. If you can pleace help me. https://imgur.com/ngZBzuv
    • game crashes before even opening (log:https://mclo.gs/M8xvX7c)
    • I have created a custom entity that extends "TamableAnimal", but I am wanting to have it spawn in the ocean. I have it spawning right now, but it spawns way too frequently even with weight set to 1. I am guessing it is because it is rolling in the spawn pool of land animals since TameableAnimal extends Animal and is different than WaterAnimal, and since no land animals spawn in the ocean it just fills every inch up with my custom entity. I have followed basic tutorials for spawning entities with Forge, but I feel like I am missing something about how to change what spawn pool this custom entity ends up in. Is it possible to change that or do I need to refactor it to be based off of WaterAnimal to get those spawn? My biome modifier JSON file: { "type": "forge:add_spawns", "biomes": "#minecraft:is_ocean", "spawners": { "type": "darwinsmysticalmounts:water_wyvern", "weight": 20, "minCount": 1, "maxCount": 1 } } My client event: event.register(ModEntityTypes.WATER_WYVERN.get(), SpawnPlacements.Type.NO_RESTRICTIONS, Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, WaterWyvernEntity::checkWaterWyvernSpawnRules, SpawnPlacementRegisterEvent.Operation.REPLACE); And the actual custom spawn rule that makes it spawn in the water: public static boolean checkWaterWyvernSpawnRules(EntityType<WaterWyvernEntity> pAnimal, LevelAccessor pLevel, MobSpawnType pSpawnType, BlockPos pPos, RandomSource pRandom) { return pPos.getY() > pLevel.getSeaLevel() - 16 && pLevel.getFluidState(pPos.below()).is(FluidTags.WATER); }  
    • Starting today, I am unable to load my modded minecraft world. Forge crash log initially said it was a specific mod called Doggy Talents, which I disabled. Then it blamed JEI, and when that was disabled it blamed another mod so I assume it's something more than a specific mod. Minecraft launcher log claims "Exit Code 1". Nothing had changed since last night when it was working fine Forge Log: https://pastebin.com/S1GiBGVJ Client Log: https://pastebin.com/aLwuGUNL  
    • I am using AMD, yes. I downloaded the website's drivers and am still having the issue. I also used the Cleanup Utility just in case. 
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.