title: Using user scripts for NPC AI in java
body: <p>For my WIP game (or maybe future games) i think about adding custom, user written scripts for the enemie/NPC AI. Doing this any user, who knows how to write scripts can write AIs for the enemies. I want to use LUA (or other scripts if it is easier), but i have really no idea how i can:</p>
  
  <ol>
  <li>Embed LUA and other scripting languages in java code</li>
  <li>Let this scripts control a specific NPC or type of NPC</li>
  <li>Have special functions in the scripting language to control if the player is near to NPC or similar things.</li>
  </ol>
  
  <p><code>Computercraft</code> mod for <code>Minecraft</code> is a good example for what i want to achieve (more or less).
  Just instead of executing exact commands (go 1 tile foreward go 2 tiles left etc.) i want to use the script for AI.
  Have you any tutorial, advice or something like that?</p>