botchallenge icon indicating copy to clipboard operation
botchallenge copied to clipboard

Looking for (hostile) mobs

Open Rafiot opened this issue 10 years ago • 4 comments

I am very very new at minecraft programming so I'm not sure this question is even relevant.

Would it be possible to know if there is an hostile mob close to the player? What I want to do is to use the robot as a guard to automatically protect the player.

Rafiot avatar Jan 29 '15 18:01 Rafiot

That's a relevant question! And a couple of other people have been asking about being able to detect mobs (both friendly and hostile).

But I think it makes more sense to know if there's a mob near the robot, the robot can follow the player around if they want to protect the player. There's also the problem that the robot can't really attack a mob, it can do damage just by moving into the mob, but it would be cool to have a real attack system. (I'm thinking fireballs or something!)

How's this (just an example, not added yet): list_of_mobs = robot.find_mobs_nearby()

It would give you a list of Mob objects, which have a type (sheep, creeper, etc.), whether it's hostile or not and a location. You can use that location to attack the mob by moving into it (or once we have fireballs, attack it properly!)

How's that sound for a plan? Maybe we could also add a find_mobs_near_player() but I'm not sure that makes sense, because if the robot is far away, it probably wouldn't get there in time to help.

katharosada avatar Jan 29 '15 22:01 katharosada

Oh, to give a rough timeframe, I can probably find the time to add this next week or the week after.

katharosada avatar Jan 29 '15 22:01 katharosada

That sounds great :)

FYI, I'm working on a curriculum to teach python to kids participating to CoderDojo in Luxembourg and your plugin is the best available.

Rafiot avatar Jan 30 '15 00:01 Rafiot

And I'm thinking about it, but find_mobs_near_player() might be interesting to print an alert message in the screen for example. It is not as useful as robot.find_mobs_nearby() but I'm sure we can find a use for that.

Rafiot avatar Jan 30 '15 00:01 Rafiot