Minor changes to make it work
Added entity id and next spare function
Added lua integration for entity id getting