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.level.h"
3#include "net.minecraft.world.entity.projectile.h"
4#include "net.minecraft.world.entity.player.h"
5#include "net.minecraft.world.item.h"
6#include "SoundTypes.h"
7#include "ExperienceItem.h"
8
9ExperienceItem::ExperienceItem(int id) : Item(id)
10{
11}
12
13bool ExperienceItem::isFoil(shared_ptr<ItemInstance> itemInstance)
14{
15 return true;
16}
17
18bool ExperienceItem::TestUse(shared_ptr<ItemInstance> itemInstance, Level *level, shared_ptr<Player> player)
19{
20 return true;
21}
22
23shared_ptr<ItemInstance> ExperienceItem::use(shared_ptr<ItemInstance> itemInstance, Level *level, shared_ptr<Player> player)
24{
25 if (!player->abilities.instabuild)
26 {
27 itemInstance->count--;
28 }
29 level->playEntitySound(player, eSoundType_RANDOM_BOW, 0.5f, 0.4f / (random->nextFloat() * 0.4f + 0.8f));
30 if (!level->isClientSide) level->addEntity( shared_ptr<ThrownExpBottle>( new ThrownExpBottle(level, player) ));
31 return itemInstance;
32}