the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 31 lines 936 B view raw
1using namespace std; 2 3#include "stdafx.h" 4#include "com.mojang.nbt.h" 5#include "net.minecraft.world.level.tile.h" 6#include "net.minecraft.world.phys.h" 7#include "net.minecraft.world.level.h" 8#include "net.minecraft.world.item.h" 9#include "net.minecraft.world.entity.player.h" 10#include "net.minecraft.world.entity.item.h" 11#include "net.minecraft.world.entity.global.h" 12#include "net.minecraft.world.entity.projectile.h" 13#include "EggItem.h" 14#include "SoundTypes.h" 15 16 17EggItem::EggItem(int id) : Item( id ) 18{ 19 maxStackSize = 16; 20} 21 22shared_ptr<ItemInstance> EggItem::use(shared_ptr<ItemInstance> instance, Level *level, shared_ptr<Player> player) 23{ 24 if (!player->abilities.instabuild) 25 { 26 instance->count--; 27 } 28 level->playEntitySound( player, eSoundType_RANDOM_BOW, 0.5f, 0.4f / (random->nextFloat() * 0.4f + 0.8f)); 29 if (!level->isClientSide) level->addEntity( shared_ptr<ThrownEgg>(new ThrownEgg(level, player)) ); 30 return instance; 31}