--- a/net/minecraft/entity/item/ItemEntity.java
+++ b/net/minecraft/entity/item/ItemEntity.java
@@ -38,6 +38,10 @@
    private UUID field_145801_f;
    private UUID field_145802_g;
    public final float field_70290_d;
+   /**
+    * The maximum age of this EntityItem.  The item is expired once this is reached.
+    */
+   public int lifespan = 6000;
 
    public ItemEntity(EntityType<? extends ItemEntity> p_i50217_1_, World p_i50217_2_) {
       super(p_i50217_1_, p_i50217_2_);
@@ -54,6 +58,7 @@
    public ItemEntity(World p_i1710_1_, double p_i1710_2_, double p_i1710_4_, double p_i1710_6_, ItemStack p_i1710_8_) {
       this(p_i1710_1_, p_i1710_2_, p_i1710_4_, p_i1710_6_);
       this.func_92058_a(p_i1710_8_);
+      this.lifespan = (p_i1710_8_.func_77973_b() == null ? 6000 : p_i1710_8_.getEntityLifespan(p_i1710_1_));
    }
 
    @OnlyIn(Dist.CLIENT)
@@ -74,6 +79,7 @@
    }
 
    public void func_70071_h_() {
+      if (func_92059_d().onEntityItemUpdate(this)) return;
       if (this.func_92059_d().func_190926_b()) {
          this.func_70106_y();
       } else {
@@ -107,7 +113,8 @@
             this.func_213315_a(MoverType.SELF, this.func_213322_ci());
             float f = 0.98F;
             if (this.field_70122_E) {
-               f = this.field_70170_p.func_180495_p(new BlockPos(this.func_226277_ct_(), this.func_226278_cu_() - 1.0D, this.func_226281_cx_())).func_177230_c().func_208618_m() * 0.98F;
+               BlockPos pos = new BlockPos(this.func_226277_ct_(), this.func_226278_cu_() - 1.0D, this.func_226281_cx_());
+               f = this.field_70170_p.func_180495_p(pos).getSlipperiness(this.field_70170_p, pos, this) * 0.98F;
             }
 
             this.func_213317_d(this.func_213322_ci().func_216372_d((double)f, 0.98D, (double)f));
@@ -140,7 +147,14 @@
             }
          }
 
-         if (!this.field_70170_p.field_72995_K && this.field_70292_b >= 6000) {
+         ItemStack item = this.func_92059_d();
+         if (!this.field_70170_p.field_72995_K && this.field_70292_b >= lifespan) {
+             int hook = net.minecraftforge.event.ForgeEventFactory.onItemExpire(this, item);
+             if (hook < 0) this.func_70106_y();
+             else          this.lifespan += hook;
+         }
+
+         if (item.func_190926_b()) {
             this.func_70106_y();
          }
 
@@ -198,6 +212,8 @@
          return false;
       } else if (p_226532_1_.func_77942_o() ^ p_226532_0_.func_77942_o()) {
          return false;
+      } else if (!p_226532_0_.areCapsCompatible(p_226532_1_)) {
+         return false;
       } else {
          return !p_226532_1_.func_77942_o() || p_226532_1_.func_77978_p().equals(p_226532_0_.func_77978_p());
       }
@@ -231,6 +247,7 @@
    }
 
    public boolean func_70097_a(DamageSource p_70097_1_, float p_70097_2_) {
+      if (this.field_70170_p.field_72995_K || this.field_70128_L) return false; //Forge: Fixes MC-53850
       if (this.func_180431_b(p_70097_1_)) {
          return false;
       } else if (!this.func_92059_d().func_190926_b() && this.func_92059_d().func_77973_b() == Items.field_151156_bN && p_70097_1_.func_94541_c()) {
@@ -252,6 +269,7 @@
       p_213281_1_.func_74777_a("Health", (short)this.field_70291_e);
       p_213281_1_.func_74777_a("Age", (short)this.field_70292_b);
       p_213281_1_.func_74777_a("PickupDelay", (short)this.field_145804_b);
+      p_213281_1_.func_74768_a("Lifespan", lifespan);
       if (this.func_200214_m() != null) {
          p_213281_1_.func_186854_a("Thrower", this.func_200214_m());
       }
@@ -272,6 +290,7 @@
       if (p_70037_1_.func_74764_b("PickupDelay")) {
          this.field_145804_b = p_70037_1_.func_74765_d("PickupDelay");
       }
+      if (p_70037_1_.func_74764_b("Lifespan")) lifespan = p_70037_1_.func_74762_e("Lifespan");
 
       if (p_70037_1_.func_186855_b("Owner")) {
          this.field_145802_g = p_70037_1_.func_186857_a("Owner");
@@ -291,10 +310,18 @@
 
    public void func_70100_b_(PlayerEntity p_70100_1_) {
       if (!this.field_70170_p.field_72995_K) {
+         if (this.field_145804_b > 0) return;
          ItemStack itemstack = this.func_92059_d();
          Item item = itemstack.func_77973_b();
          int i = itemstack.func_190916_E();
-         if (this.field_145804_b == 0 && (this.field_145802_g == null || this.field_145802_g.equals(p_70100_1_.func_110124_au())) && p_70100_1_.field_71071_by.func_70441_a(itemstack)) {
+
+         int hook = net.minecraftforge.event.ForgeEventFactory.onItemPickup(this, p_70100_1_);
+         if (hook < 0) return;
+
+         ItemStack copy = itemstack.func_77946_l();
+         if (this.field_145804_b == 0 && (this.field_145802_g == null || lifespan - this.field_70292_b <= 200 || this.field_145802_g.equals(p_70100_1_.func_110124_au())) && (hook == 1 || i <= 0 || p_70100_1_.field_71071_by.func_70441_a(itemstack))) {
+            copy.func_190920_e(copy.func_190916_E() - func_92059_d().func_190916_E());
+            net.minecraftforge.fml.hooks.BasicEventHooks.firePlayerItemPickupEvent(p_70100_1_, this, copy);
             p_70100_1_.func_71001_a(this, i);
             if (itemstack.func_190926_b()) {
                this.func_70106_y();
@@ -318,8 +345,8 @@
    }
 
    @Nullable
-   public Entity func_241206_a_(ServerWorld p_241206_1_) {
-      Entity entity = super.func_241206_a_(p_241206_1_);
+   public Entity changeDimension(ServerWorld p_241206_1_, net.minecraftforge.common.util.ITeleporter teleporter) {
+      Entity entity = super.changeDimension(p_241206_1_, teleporter);
       if (!this.field_70170_p.field_72995_K && entity instanceof ItemEntity) {
          ((ItemEntity)entity).func_85054_d();
       }
@@ -392,7 +419,7 @@
 
    public void func_174870_v() {
       this.func_174871_r();
-      this.field_70292_b = 5999;
+      this.field_70292_b = func_92059_d().getEntityLifespan(field_70170_p) - 1;
    }
 
    @OnlyIn(Dist.CLIENT)
