Fixed various entity-related bugs (spawn packet, replacement), added FAIL state for item parser

Signed-off-by: Irmo van den Berge <bergerkiller@gmail.com>