UUID ID = UUID.fromString("e3723b50-7cc6-11e3-baa7-0800200c9a66");
int hp = 980;
AttributeModifier healthModifier = new AttributeModifier(ID,"NAME",hp, 0);
if(player.getEntityAttribute(SharedMonsterAttributes.maxHealth).getModifier(StatInstance.ID) != null)
player.getEntityAttribute(SharedMonsterAttributes.maxHealth).removeModifier(healthModifier);
player.getEntityAttribute(SharedMonsterAttributes.maxHealth).applyModifier(healthModifier);
Это у тебя не вышло.Micertes написал(а):Пробовал как-то, не вышлоhohserg написал(а):А вообще у игрока можно увеличить макс. кол-во хп без asm и рефлексии? Я проверить не могу: другое приложение открыто, среда с ним лагает
Воо, об этом я писал. Там само будет на макс ставиться.Tuborg написал(а):Вот вам кусочек моего кода, наслаждайтесь:
Код:UUID ID = UUID.fromString("e3723b50-7cc6-11e3-baa7-0800200c9a66"); int hp = 980; AttributeModifier healthModifier = new AttributeModifier(ID,"NAME",hp, 0); if(player.getEntityAttribute(SharedMonsterAttributes.maxHealth).getModifier(StatInstance.ID) != null) player.getEntityAttribute(SharedMonsterAttributes.maxHealth).removeModifier(healthModifier); player.getEntityAttribute(SharedMonsterAttributes.maxHealth).applyModifier(healthModifier);