Search in sources :

Example 6 with EntityItemProjectileImpl

use of com.denizenscript.denizen.nms.v1_17.impl.entities.EntityItemProjectileImpl in project Denizen-For-Bukkit by DenizenScript.

the class CustomEntityHelperImpl method spawnItemProjectile.

@Override
public ItemProjectile spawnItemProjectile(Location location, ItemStack itemStack) {
    CraftWorld world = (CraftWorld) location.getWorld();
    EntityItemProjectileImpl entity = new EntityItemProjectileImpl(world.getHandle(), location, CraftItemStack.asNMSCopy(itemStack));
    world.getHandle().addEntity(entity, CreatureSpawnEvent.SpawnReason.CUSTOM);
    return entity.getBukkitEntity();
}
Also used : EntityItemProjectileImpl(com.denizenscript.denizen.nms.v1_17.impl.entities.EntityItemProjectileImpl) CraftWorld(org.bukkit.craftbukkit.v1_17_R1.CraftWorld)

Aggregations

EntityTag (com.denizenscript.denizen.objects.EntityTag)3 ItemTag (com.denizenscript.denizen.objects.ItemTag)3 PlayerTag (com.denizenscript.denizen.objects.PlayerTag)3 FakeEntity (com.denizenscript.denizen.utilities.entity.FakeEntity)3 Mechanism (com.denizenscript.denizencore.objects.Mechanism)3 ItemStack (org.bukkit.inventory.ItemStack)3 BukkitRunnable (org.bukkit.scheduler.BukkitRunnable)3 EntityItemProjectileImpl (com.denizenscript.denizen.nms.v1_16.impl.entities.EntityItemProjectileImpl)2 EntityItemProjectileImpl (com.denizenscript.denizen.nms.v1_17.impl.entities.EntityItemProjectileImpl)2 EntityItemProjectileImpl (com.denizenscript.denizen.nms.v1_18.impl.entities.EntityItemProjectileImpl)2 ServerEntity (net.minecraft.server.level.ServerEntity)2 ServerPlayer (net.minecraft.server.level.ServerPlayer)2 ServerGamePacketListenerImpl (net.minecraft.server.network.ServerGamePacketListenerImpl)2 CraftWorld (org.bukkit.craftbukkit.v1_16_R3.CraftWorld)2 CraftWorld (org.bukkit.craftbukkit.v1_17_R1.CraftWorld)2 CraftWorld (org.bukkit.craftbukkit.v1_18_R1.CraftWorld)2 CraftFakePlayerImpl (com.denizenscript.denizen.nms.v1_16.impl.entities.CraftFakePlayerImpl)1 CraftFakePlayerImpl (com.denizenscript.denizen.nms.v1_17.impl.entities.CraftFakePlayerImpl)1 CraftFakePlayerImpl (com.denizenscript.denizen.nms.v1_18.impl.entities.CraftFakePlayerImpl)1 net.minecraft.server.v1_16_R3 (net.minecraft.server.v1_16_R3)1