Combination of Virtual Reality and Artificial Intelligence technologies offer very interesting possibilities for educational purposes, allowing to design creative, intelligent and dynamic 3D virtual learning environments. However, nowadays there are few programming environments and tools that support Artificial Intelligence and agent programming techniques to control virtual 3D avatars. Aiming to help in this question, this work introduces a logical programming environment, which extends Prolog with BDI and multi-agent programming concepts and is fully integrated with Virtual Reality technology. The paper shows how this programming environment was used to create an interactive, animated and intelligent virtual world, focused on teaching the beginnings of Industrial Evolution. This educational virtual world was positively evaluated through experiments carried out with simulated classes of History.