本文整理匯總了Java中org.bukkit.entity.EntityType.FALLING_BLOCK屬性的典型用法代碼示例。如果您正苦於以下問題:Java EntityType.FALLING_BLOCK屬性的具體用法?Java EntityType.FALLING_BLOCK怎麽用?Java EntityType.FALLING_BLOCK使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.bukkit.entity.EntityType
的用法示例。
在下文中一共展示了EntityType.FALLING_BLOCK屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onAnvilLand
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onAnvilLand(EntityChangeBlockEvent event) {
if (!this.tracker.isEnabled(event.getEntity().getWorld())) return;
if (event.getEntityType() == EntityType.FALLING_BLOCK && event.getTo() == Material.ANVIL) {
OfflinePlayer owner = tracker.getOwner((FallingBlock) event.getEntity());
if(owner != null) {
tracker.setPlacer(event.getBlock(), tracker.getOwner((FallingBlock) event.getEntity()));
tracker.setOwner((FallingBlock) event.getEntity(), null);
}
}
}
示例2: getType
public EntityType getType() {
return EntityType.FALLING_BLOCK;
}
示例3: summonEntity
public static boolean summonEntity(Location loc, int amount, EntityType entity, World world){
EntityType e = EntityType.FALLING_BLOCK;
try{
e = entity;
} catch (IllegalArgumentException ex){
ex.printStackTrace();
return false;
}
int i = 0;
for (i = 0; i < amount; i++){
loc.getWorld().spawnEntity(loc, e);
}
return true;
}