the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#include "stdafx.h"
2#include "net.minecraft.world.entity.player.h"
3#include "net.minecraft.world.entity.projectile.h"
4#include "net.minecraft.world.item.h"
5#include "net.minecraft.world.level.h"
6#include "SnowballItem.h"
7#include "SoundTypes.h"
8
9SnowballItem::SnowballItem(int id) : Item(id)
10{
11 this->maxStackSize = 16;
12}
13
14shared_ptr<ItemInstance> SnowballItem::use(shared_ptr<ItemInstance> instance, Level *level, shared_ptr<Player> player)
15{
16 if (!player->abilities.instabuild)
17 {
18 instance->count--;
19 }
20 level->playEntitySound((shared_ptr<Entity> ) player, eSoundType_RANDOM_BOW, 0.5f, 0.4f / (random->nextFloat() * 0.4f + 0.8f));
21 if (!level->isClientSide) level->addEntity( shared_ptr<Snowball>( new Snowball(level, player) ) );
22 return instance;
23}