Сидеть в Entity

Версия Minecraft
1.7.10
929
30
66
Всем привет , сделал большое Entity и запретил проходить сквозь него , но мне нужно в него садиться и когда сажусь меня поднимает вверх , Entity выталкивает меня , что можно с этим сделать?
 
3,005
192
592
Найти где Entity толкает игрока, проверять если игрок сидит на нем - то не выталкивать, как вариант.
 

tox1cozZ

aka Agravaine
8,455
598
2,892
Добавь в энтити.
Java:
@Override
    public float getCollisionBorderSize(){
        return 0.0F;
    }
    
    @Override
    public void applyEntityCollision(Entity entity){
        
    }
    
    @Override
    public AxisAlignedBB getCollisionBox(Entity entity){
        return entity.boundingBox;
    }

    @Override
    public AxisAlignedBB getBoundingBox(){
        return boundingBox;
    }
    
    @Override
    public boolean canBeCollidedWith(){
        return !isDead;
    }
 
929
30
66
Java:
public class EntityHouse extends EntityAnimal implements IInventory{

       protected final ItemStack[] field_82182_bS = new ItemStack[54];
       protected final Deque auxInventory = new LinkedList();
       private long deathTimestamp = Long.MAX_VALUE;
       public int despawnTime;
       public String playerName = "House";
       private int time;
       private boolean deadMode = false;

       public EntityHouse(World par1World) {
          super(par1World);
          this.setSize(3.150F, 2.6F);
       }
     
    public EntityHouse(World par1World, String s) {
          super(par1World);
          this.playerName = s;
       }

       public String getCommandSenderName() {
          return this.playerName;
       }
     
       protected void applyEntityAttributes() {
          super.applyEntityAttributes();
          this.getAttributeMap().getAttributeInstance(SharedMonsterAttributes.maxHealth).setBaseValue(0.1D);
       }

       public void onLivingUpdate() {}

       public void onEntityUpdate() {
          super.onEntityUpdate();
       }

       protected String getHurtSound() {
          return null;
       }

       public void readEntityFromNBT(NBTTagCompound par1nbtTagCompound) {
       }

       public void writeEntityToNBT(NBTTagCompound par1nbtTagCompound) {
       }

       public EntityAgeable createChild(EntityAgeable entityageable) {
          return null;
       }

       public ItemStack getEquipmentInSlot(int slot) {
          return this.field_82182_bS[slot % this.field_82182_bS.length];
       }

       @Deprecated
       public ItemStack getCurrentArmor(int armorSlot) {
          return this.getEquipmentInSlot(armorSlot + 1);
       }

       public ItemStack armorItemInSlot(int i) {
          return this.getCurrentArmor(i);
       }

       public void setCurrentItemOrArmor(int slot, ItemStack item) {
          this.field_82182_bS[slot] = item;
       }

       @Deprecated
       public ItemStack[] getInventory() {
          return this.field_82182_bS;
       }

       private boolean canStack(ItemStack a, ItemStack b) {
          if(a != null && b != null) {
             if(a.getItem() == b.getItem() && a.isStackable()) {
                if(a.getItemDamage() != b.getItemDamage()) {
                   return false;
                }

                if(!a.isStackable()) {
                   return false;
                }

                if(a.stackSize + b.stackSize > Math.min(a.getMaxStackSize(), this.getInventoryStackLimit())) {
                   return false;
                }

                if(!a.hasTagCompound() && !b.hasTagCompound()) {
                   return true;
                }

                if(a.hasTagCompound() && b.hasTagCompound()) {
                   return ItemStack.areItemStackTagsEqual(a, b);
                }
             }

             return false;
          } else {
             return false;
          }
       }

       public void setDeathTime(long timestamp) {
          this.deathTimestamp = timestamp;
       }

       public int getTalkInterval() {
          return 1200;
       }

       public void playLivingSound() {}

       public boolean canBreatheUnderwater() {
          return true;
       }

       protected int getExperiencePoints(EntityPlayer p_getExperiencePoints_1_) {
          return 0;
       }

       @SideOnly(Side.CLIENT)
       public void handleHealthUpdate(byte p_handleHealthUpdate_1_) {}

       protected String getLivingSound() {
          return null;
       }

       protected Item getDropItem() {
          return null;
       }

       public boolean canBeSteered() {
          return false;
       }

       public void setEquipmentDropChance(int p_setEquipmentDropChance_1_, float p_setEquipmentDropChance_2_) {}

       public boolean canPickUpLoot() {
          return false;
       }

       public void setCanPickUpLoot(boolean p_setCanPickUpLoot_1_) {}

       public boolean interact(EntityPlayer player) {
              //player.displayGUIChest(this);
           EntitySit sit = new EntitySit(player.worldObj);//Создаём объект нашего EntitySit
            //Даём ему координаты
            sit.setPosition((double)super.posX + 0.5D, (double)super.posY + 0.5D, (double)super.posZ + 0.5D);
            if (!player.worldObj.isRemote) {
                player.worldObj.spawnEntityInWorld(sit);//спавним нашего EntitySit.
                player.mountEntity(sit);//Игрок оседлает нашего EntitySit
                } else {
                    if(super.riddenByEntity != null) {
                        player.displayGUIChest(this);
                    }
                }

            return false;
        }

       public boolean allowLeashing() {
          return false;
       }
       public boolean isAIEnabled() {
              return true;
           }
       protected void playSound(String soundID) {
          if(!super.worldObj.isRemote) {
             super.worldObj.playSoundAtEntity(this, soundID, 0.5F, 0.4F);
          }

       }

       public void clear() {
          for(int i = 0; i < this.field_82182_bS.length; ++i) {
             this.field_82182_bS[i] = null;
          }

          this.auxInventory.clear();
       }
       @Override
        public float getCollisionBorderSize(){
            return 0.0F;
        }
       
        @Override
        public void applyEntityCollision(Entity entity){
           
        }
       
        @Override
        public AxisAlignedBB getCollisionBox(Entity entity){
            return entity.boundingBox;
        }

        @Override
        public AxisAlignedBB getBoundingBox(){
            return boundingBox;
        }
       
        @Override
        public boolean canBeCollidedWith(){
            return !isDead;
        }
       public void clearInventory() {
          this.clear();
       }

    }
 
Последнее редактирование:
929
30
66
Такой вопрос,а при чём тут декомпил ?(Sit взял с мода Серёги mod_sit)
Ну сяду я по ванили,я буду выше чуть энтити , как можно опустить его ниже ?
 
Последнее редактирование:
Сверху