package io.gitlab.jfronny.yescheat.mixin; import net.minecraft.entity.EntityType; import net.minecraft.entity.ai.goal.TemptGoal; import net.minecraft.entity.passive.MerchantEntity; import net.minecraft.entity.passive.VillagerEntity; import net.minecraft.item.Items; import net.minecraft.recipe.Ingredient; import net.minecraft.village.VillagerType; import net.minecraft.world.World; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(VillagerEntity.class) public abstract class VillagerEntityMixin extends MerchantEntity { public VillagerEntityMixin(EntityType entityType, World world) { super(entityType, world); } @Inject(method = "(Lnet/minecraft/entity/EntityType;Lnet/minecraft/world/World;Lnet/minecraft/village/VillagerType;)V", at = @At(value = "TAIL")) private void inject(EntityType entityType, World world, VillagerType type, CallbackInfo ci) { this.goalSelector.add(2, new TemptGoal(this, .4D, Ingredient.ofItems(Items.EMERALD_BLOCK, Items.EMERALD_ORE, Items.DEEPSLATE_EMERALD_ORE), false)); } }