File tree Expand file tree Collapse file tree
java/wayoftime/bloodmagic/util/handler/event
resources/assets/bloodmagic/patchouli_books/guide/en_us/entries/alchemy_array/living_equipment/armor_upgrades Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313import net .minecraft .world .entity .LivingEntity ;
1414import net .minecraft .world .entity .ai .goal .MeleeAttackGoal ;
1515import net .minecraft .world .entity .ai .goal .target .TargetGoal ;
16+ import net .minecraft .world .entity .monster .piglin .Piglin ;
1617import net .minecraft .world .entity .player .Player ;
1718import net .minecraft .world .entity .projectile .Arrow ;
1819import net .minecraft .world .entity .projectile .ThrowableProjectile ;
@@ -1190,4 +1191,16 @@ public static int getChargeTime(ItemStack stack)
11901191 int i = EnchantmentHelper .getItemEnchantmentLevel (Enchantments .QUICK_CHARGE , stack );
11911192 return i == 0 ? 25 : 25 - 5 * i ;
11921193 }
1194+
1195+ @ SubscribeEvent
1196+ public void onEntityInteract (PlayerInteractEvent .EntityInteract event ){
1197+ if (event .getTarget () instanceof Piglin && event .getItemStack ().is (Items .GOLD_INGOT ))
1198+ {
1199+ Player player = event .getEntity ();
1200+ if (LivingUtil .hasFullSet (player ))
1201+ {
1202+ LivingUtil .applyNewExperience (player , LivingArmorRegistrar .UPGRADE_GILDED .get (), 1 );
1203+ }
1204+ }
1205+ }
11931206}
Original file line number Diff line number Diff line change 1+ {
2+ "name" : " Gilded" ,
3+ "icon" : " minecraft:golden_chestplate" ,
4+ "category" : " bloodmagic:alchemy_array/living_equipment/armor_upgrades" ,
5+ "pages" : [
6+ {
7+ "type" : " patchouli:text" ,
8+ "text" : " Effect: Passivises Piglins as if you were wearing Golden Armor.$(br2)Trained by: Giving a Piglin a $(item)Gold Ingot$(). You must give it to them directly, it cannot be dropped on the ground.$(br2)Maximum level: 1"
9+ },
10+ {
11+ "type" : " bloodmagic:living_armour_upgrade_table" ,
12+ "upgrade" : " bloodmagic:gilded"
13+ }
14+ ]
15+ }
You can’t perform that action at this time.
0 commit comments