- 198
- 1
- 24
Как можно создать предмет, который будет "влезать" в нижние слоты зельеварки? Смотрел в PotionItem, не нашёл. Бутылёк воды и дыхание дракона вообще не могу найти. Например, вот у меня тут есть кровь эндермена, в игре она отображается нормально и даёт эффект как от хоруса, но вот в зельеварку вниз не лезет:
Кровь эндермена:
public class ItemEndermanBlood extends Item {
public ItemEndermanBlood() {
super(new Properties()
.food(new Food.Builder()
.alwaysEat()
.build())
.tab(Zombienation.CREATIVE_TAB));
}
@Override
public ItemStack finishUsingItem(ItemStack stack, World worldIn, LivingEntity entity) {
/* Chorus fruit teleportation code */
if (!worldIn.isClientSide) {
double d0 = entity.getX();
double d1 = entity.getY();
double d2 = entity.getZ();
for(int i = 0; i < 16; ++i) {
double d3 = entity.getX() + (entity.getRandom().nextDouble() - 0.5D) * 16.0D;
double d4 = MathHelper.clamp(entity.getY() + (double)(entity.getRandom().nextInt(16) - 8), 0.0D, (double)(worldIn.getHeight() - 1));
double d5 = entity.getZ() + (entity.getRandom().nextDouble() - 0.5D) * 16.0D;
if (entity.isPassenger()) {
entity.stopRiding();
}
if (entity.randomTeleport(d3, d4, d5, true)) {
SoundEvent soundevent = entity instanceof FoxEntity ? SoundEvents.FOX_TELEPORT : SoundEvents.CHORUS_FRUIT_TELEPORT;
worldIn.playSound((PlayerEntity)null, d0, d1, d2, soundevent, SoundCategory.PLAYERS, 1.0F, 1.0F);
entity.playSound(soundevent, 1.0F, 1.0F);
break;
}
}
if (entity instanceof PlayerEntity) {
((PlayerEntity)entity).getCooldowns().addCooldown(this, 20);
}
}
/* End chorus fruit teleportation code */
ItemHandlerHelper.giveItemToPlayer((PlayerEntity) entity, new ItemStack(Items.GLASS_BOTTLE,1));
stack.shrink(1);
return stack;
}
@Override
public UseAction getUseAnimation(ItemStack p_77661_1_) {
return UseAction.DRINK;
}
}