Something went wrong. Try again.
the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
Something went wrong. Try again.
634 B · 23 lines
C++
at main
1234567891011121314151617181920212223#include "stdafx.h"#include "net.minecraft.world.entity.h"#include "NameTagItem.h"
NameTagItem::NameTagItem(int id) : Item(id){}
bool NameTagItem::interactEnemy(shared_ptr<ItemInstance> itemInstance, shared_ptr<Player> player, shared_ptr<LivingEntity> target){ if (!itemInstance->hasCustomHoverName()) return false;
if ( (target != NULL) && target->instanceof(eTYPE_MOB) ) { shared_ptr<Mob> mob = dynamic_pointer_cast<Mob>(target); mob->setCustomName(itemInstance->getHoverName()); mob->setPersistenceRequired(); itemInstance->count--; return true; }
return Item::interactEnemy(itemInstance, player, target);}