use of org.bukkit.craftbukkit.v1_13_R1.entity.CraftItem in project Magma by magmafoundation.
the class CraftWorld method dropItem.
public Item dropItem(Location loc, ItemStack item) {
Validate.notNull(item, "Cannot drop a Null item.");
Validate.isTrue(item.getTypeId() != 0, "Cannot drop AIR.");
EntityItem entity = new EntityItem(world, loc.getX(), loc.getY(), loc.getZ(), CraftItemStack.asNMSCopy(item));
entity.pickupDelay = 10;
world.spawnEntity(entity, SpawnReason.CUSTOM);
// However, this entity is not at the moment backed by a server entity class so it may be left.
return new CraftItem(world.getServer(), entity);
}
Aggregations