Guest User

Untitled

a guest
Dec 14th, 2019
94
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @Override
  2. public ActionResult<ItemStack> onItemRightClick(World worldIn, PlayerEntity playerIn, Hand handIn) {
  3. ItemStack itemStack = playerIn.getHeldItem(handIn);
  4. CompoundNBT nbt = itemStack.getOrCreateTag();
  5. if(!worldIn.isRemote) {
  6. // EntityPukeBall ball = new EntityPukeBall(EntityType.SNOWBALL, );
  7. //EntityPukeBall ball = new EntityPukeBall(ModThings.ENTITY_PUKEBALL, playerIn, worldIn);
  8. //ball.shoot(playerIn, playerIn.rotationPitch, playerIn.rotationYaw, 0F, 1.5F, 1.0F);
  9. //worldIn.addEntity(ball);
  10. SnowballEntity entity = new SnowballEntity(EntityType.SNOWBALL, worldIn);
  11. entity.shoot(playerIn, playerIn.rotationPitch, playerIn.rotationYaw, 0F, 1.5F, 1.0F);
  12. worldIn.addEntity(entity);
  13. }
  14. return ActionResult.newResult(ActionResultType.SUCCESS, itemStack);
  15. }
RAW Paste Data