Try this: PHP: function init(){ ServerAPI::request()->schedule(SCHEDULED_TIME, array($this, "clearAll"));}function clearAll(){ $ents=ServerAPI::request()->api->entity->getAll(LEVEL_OBJECT_OR_NULL); foreach($ents as $ent){ if($ent->class===ENTITY_ITEM){ $ent->setPosition(new Position(-256, 128, -256, $ent->level)); $ent->close(); }}