(function(){ var targetType = "bush"; var teleport; var portalDestination; var animationURL; this.enterEntity = function(entityID) { print("EnterEntity"); }; this.leaveEntity = function(entityID) { print("leaveEntity"); }; this.getUserData = function() { if (this.properties.userData) { this.userData = JSON.parse(this.properties.userData); } else { this.userData = {}; } }; this.updateUserData = function() { Entities.editEntity(this.entityId, { userData: JSON.stringify(this.userData) }); }; this.preload = function(entityId) { print("!!!! entity preload"); this.entityId = entityId; this.properties = Entities.getEntityProperties(this.entityId); this.getUserData(); this.userData.pdType = "bush"; this.userData.pdDescription = "This bush is rather fun!"; this.updateUserData(); }; print("***** Default entity script started."); });