MineInAbyss / Mobzy

Config-driven custom mobs for Spigot using ECS
https://mineinabyss.com/Mobzy/
MIT License
41 stars 8 forks source link

PathfinderGoal which picks randomly from a list of subgoals #24

Open 0ffz opened 4 years ago

0ffz commented 4 years ago

The goal would randomly pick subgoals until one works, and keep doing the one so long as it can keep executing. Unsure if this is what minecraft does with two equal priority goals, but we may want a weighted random option as well.

The idea would be to achieve this pattern after serialized:

pathfinders:
    1: !<random>
       - !<goal1> {}
       - !<goal2> {}

Unsure how a weighted random could work in this case, can't use maps because we may want repeated values.