Jump to content

[1.7.10] Adding trade to "new" villager type mob


DonKresenko

Recommended Posts

First of all, I'M NOT MAKING A NEW VILLAGER TYPE (that one is easy), I'm making a new MOB that can trade with the player and has only 1 trade. The mob has a custom model and custom render (that part is done), but I can't get the trade to work. The GUI shows up when i right-click on a mob, but there's a blank trade (see photo). Anyone know how to fix it? Would help :)

 

Problem photo

Y0fTgG2.png

 

Entity code

package com.blabla.test;

import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Tuple;
import net.minecraft.village.MerchantRecipe;
import net.minecraft.village.MerchantRecipeList;
import net.minecraft.world.World;

public class EntityWizard extends EntityVillager {

private MerchantRecipeList buyingList;

public EntityWizard(World w) {
	super(w);
}

@Override
public MerchantRecipeList getRecipes(EntityPlayer player) {
	if (this.buyingList == null)
        {
            this.addDefaultEquipmentAndRecipies(1);
        }

        return this.buyingList;
    }

@Override
public void setRecipes(MerchantRecipeList recipeList) {
	recipeList.add(new MerchantRecipe(new ItemStack(Items.ghast_tear, 8, 0), null, new ItemStack(Items.arrow, 16)));
}

public void addDefaultEquipmentAndRecipies(int i) {
	MerchantRecipeList merchantrecipelist;
        merchantrecipelist = new MerchantRecipeList();
        
        merchantrecipelist.add(new MerchantRecipe(new ItemStack(Items.ghast_tear, 8, 0), null, new ItemStack(Items.arrow, 16)));
        
}

}

_         

___ ___| |__  _ __ 

/ __/ __| '_ \| '_ \

\__ \__ \ | | | | | |

|___/___/_| |_|_| |_|

Link to comment
Share on other sites

Got the recipe working, but it crashes when i use the trade

 

source

package com.nuclearbanana.anticraft.entity;

import com.nuclearbanana.anticraft.AntiCraft;

import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Tuple;
import net.minecraft.village.MerchantRecipe;
import net.minecraft.village.MerchantRecipeList;
import net.minecraft.world.World;

public class EntityWizard extends EntityVillager {

//private MerchantRecipeList buyingList;

public EntityWizard(World w) {
	super(w);
}

@Override
public MerchantRecipeList getRecipes(EntityPlayer player) {
	MerchantRecipeList merchantrecipelist = new MerchantRecipeList();
	 merchantrecipelist.add(new MerchantRecipe(new ItemStack(Items.ghast_tear, 8, 0), new ItemStack(AntiCraft.Triphophyllite), new ItemStack(AntiCraft.Kukstibite, 16)));
	return merchantrecipelist;
    }

@Override
public void setRecipes(MerchantRecipeList recipeList) {
	recipeList.add(new MerchantRecipe(new ItemStack(Items.ghast_tear, 8, 0), new ItemStack(AntiCraft.Triphophyllite), new ItemStack(AntiCraft.Kukstibite, 16)));
}

public void addDefaultEquipmentAndRecipies(int i) {
	MerchantRecipeList merchantrecipelist;
        merchantrecipelist = new MerchantRecipeList();
        
        merchantrecipelist.add(new MerchantRecipe(new ItemStack(Items.ghast_tear, 8, 0), new ItemStack(AntiCraft.Triphophyllite), new ItemStack(AntiCraft.Kukstibite, 16)));
        
}

}

 

Crash report \/

 

 

[16:02:02] [main/INFO] [GradleStart]: Extra: []

[16:02:02] [main/INFO] [GradleStart]: Running with arguments: [--userProperties, {}, --assetsDir, C:/Users/Srbislav/.gradle/caches/minecraft/assets, --assetIndex, 1.7.10, --accessToken, {REDACTED}, --version, 1.7.10, --tweakClass, cpw.mods.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.GradleStartCommon$GradleStartTweaker]

[16:02:02] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLTweaker

[16:02:02] [main/INFO] [LaunchWrapper]: Using primary tweak class name cpw.mods.fml.common.launcher.FMLTweaker

[16:02:02] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.GradleStartCommon$GradleStartTweaker

[16:02:02] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLTweaker

[16:02:02] [main/INFO] [FML]: Forge Mod Loader version 7.10.85.1230 for Minecraft 1.7.10 loading

[16:02:02] [main/INFO] [FML]: Java is Java HotSpot Client VM, version 1.8.0_25, running on Windows 8.1:x86:6.3, installed at C:\Program Files\Java\jre1.8.0_25

[16:02:02] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation

[16:02:02] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.GradleStartCommon$GradleStartTweaker

[16:02:02] [main/INFO] [GradleStart]: Injecting location in coremod cpw.mods.fml.relauncher.FMLCorePlugin

[16:02:02] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin

[16:02:02] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker

[16:02:02] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLDeobfTweaker

[16:02:02] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker

[16:02:02] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker

[16:02:02] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper

[16:02:03] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!

[16:02:08] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing

[16:02:08] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper

[16:02:08] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLDeobfTweaker

[16:02:09] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.TerminalTweaker

[16:02:09] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.TerminalTweaker

[16:02:09] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}

[16:02:11] [main/INFO]: Setting user: Player209

[16:02:15] [Client thread/INFO]: LWJGL Version: 2.9.1

[16:02:17] [Client thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization

[16:02:17] [Client thread/INFO] [FML]: MinecraftForge v10.13.2.1230 Initialized

[16:02:17] [Client thread/INFO] [FML]: Replaced 182 ore recipies

[16:02:17] [Client thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization

[16:02:18] [Client thread/INFO] [FML]: Searching C:\Users\Srbislav\Desktop\Mihajlo\AntiCraft\eclipse\mods for mods

[16:02:26] [Client thread/INFO] [FML]: Forge Mod Loader has identified 4 mods to load

[16:02:26] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, anticraft] at CLIENT

[16:02:26] [Client thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, Forge, anticraft] at SERVER

[16:02:27] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:§4AntiCraft

[16:02:28] [Client thread/INFO] [FML]: Processing ObjectHolder annotations

[16:02:28] [Client thread/INFO] [FML]: Found 341 ObjectHolder annotations

[16:02:28] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0

[16:02:28] [Client thread/INFO] [FML]: Applying holder lookups

[16:02:28] [Client thread/INFO] [FML]: Holder lookups applied

[16:02:29] [sound Library Loader/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:

[16:02:29] [sound Library Loader/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Starting up SoundSystem...

[16:02:29] [Thread-6/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Initializing LWJGL OpenAL

[16:02:29] [Thread-6/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:    (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)

[16:02:30] [Thread-6/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: OpenAL initialized.

[16:02:30] [sound Library Loader/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:

[16:02:30] [sound Library Loader/INFO]: Sound engine started

[16:02:37] [Client thread/INFO]: Created: 512x256 textures/blocks-atlas

[16:02:38] [Client thread/INFO]: Created: 256x256 textures/items-atlas

[16:02:38] [Client thread/INFO] [sTDOUT]: [com.nuclearbanana.anticraft.AntiCraft:postInit:172]: AntiCraft loaded!

[16:02:38] [Client thread/INFO] [FML]: Forge Mod Loader has successfully loaded 4 mods

[16:02:38] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:§4AntiCraft

[16:02:40] [Client thread/INFO]: Created: 512x256 textures/blocks-atlas

[16:02:41] [Client thread/INFO]: Created: 256x256 textures/items-atlas

[16:02:41] [Client thread/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:

[16:02:41] [Client thread/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: SoundSystem shutting down...

[16:02:41] [Client thread/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:importantMessage:90]:    Author: Paul Lamb, www.paulscode.com

[16:02:41] [Client thread/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:

[16:02:41] [sound Library Loader/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:

[16:02:41] [sound Library Loader/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Starting up SoundSystem...

[16:02:42] [Thread-8/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: Initializing LWJGL OpenAL

[16:02:42] [Thread-8/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:    (The LWJGL binding of OpenAL.  For more information, see http://www.lwjgl.org)

[16:02:42] [Thread-8/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]: OpenAL initialized.

[16:02:42] [sound Library Loader/INFO] [sTDOUT]: [paulscode.sound.SoundSystemLogger:message:69]:

[16:02:42] [sound Library Loader/INFO]: Sound engine started

[16:03:00] [server thread/INFO]: Starting integrated minecraft server version 1.7.10

[16:03:00] [server thread/INFO]: Generating keypair

[16:03:01] [server thread/INFO] [FML]: Injecting existing block and item data into this server instance

[16:03:01] [server thread/INFO] [FML]: Applying holder lookups

[16:03:01] [server thread/INFO] [FML]: Holder lookups applied

[16:03:01] [server thread/INFO] [FML]: Loading dimension 0 (AntiCraft Test) (net.minecraft.server.integrated.IntegratedServer@18abf25)

[16:03:02] [server thread/INFO] [FML]: Loading dimension 1 (AntiCraft Test) (net.minecraft.server.integrated.IntegratedServer@18abf25)

[16:03:02] [server thread/INFO] [FML]: Loading dimension -1 (AntiCraft Test) (net.minecraft.server.integrated.IntegratedServer@18abf25)

[16:03:02] [server thread/INFO]: Preparing start region for level 0

[16:03:03] [server thread/INFO]: Preparing spawn area: 16%

[16:03:04] [server thread/INFO]: Preparing spawn area: 49%

[16:03:05] [server thread/INFO]: Preparing spawn area: 88%

[16:03:06] [server thread/INFO]: Changing view distance to 6, from 10

[16:03:07] [Netty Client IO #0/INFO] [FML]: Server protocol version 1

[16:03:07] [Netty IO #1/INFO] [FML]: Client protocol version 1

[16:03:07] [Netty IO #1/INFO] [FML]: Client attempting to join with 4 mods : [email protected],[email protected],[email protected],[email protected]

[16:03:07] [Netty IO #1/INFO] [FML]: Attempting connection with missing mods [] at CLIENT

[16:03:07] [Netty Client IO #0/INFO] [FML]: Attempting connection with missing mods [] at SERVER

[16:03:07] [Client thread/INFO] [FML]: [Client thread] Client side modded connection established

[16:03:07] [server thread/INFO] [FML]: [server thread] Server side modded connection established

[16:03:07] [server thread/INFO]: Player209[local:E:dc4007fd] logged in with entity id 163 at (-226.13511905513528, 52.0, -653.364649710334)

[16:03:07] [server thread/INFO]: Player209 joined the game

[16:03:16] [server thread/INFO]: Saving and pausing game...

[16:03:16] [server thread/INFO]: Saving chunks for level 'AntiCraft Test'/Overworld

[16:03:16] [server thread/INFO]: Saving chunks for level 'AntiCraft Test'/Nether

[16:03:16] [server thread/INFO]: Saving chunks for level 'AntiCraft Test'/The End

[16:03:30] [server thread/INFO]: Player209 has just earned the achievement [Taking Inventory]

[16:03:30] [Client thread/INFO]: [CHAT] Player209 has just earned the achievement [Taking Inventory]

[16:03:38] [server thread/ERROR]: Encountered an unexpected exception

net.minecraft.util.ReportedException: Ticking memory connection

at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:198) ~[NetworkSystem.class:?]

at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726) ~[MinecraftServer.class:?]

at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614) ~[MinecraftServer.class:?]

at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) ~[integratedServer.class:?]

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485) [MinecraftServer.class:?]

at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) [MinecraftServer$2.class:?]

Caused by: java.lang.NullPointerException

at net.minecraft.entity.passive.EntityVillager.useRecipe(EntityVillager.java:395) ~[EntityVillager.class:?]

at net.minecraft.inventory.SlotMerchantResult.onPickupFromSlot(SlotMerchantResult.java:80) ~[slotMerchantResult.class:?]

at net.minecraft.inventory.Container.slotClick(Container.java:347) ~[Container.class:?]

at net.minecraft.network.NetHandlerPlayServer.processClickWindow(NetHandlerPlayServer.java:955) ~[NetHandlerPlayServer.class:?]

at net.minecraft.network.play.client.C0EPacketClickWindow.processPacket(C0EPacketClickWindow.java:41) ~[C0EPacketClickWindow.class:?]

at net.minecraft.network.play.client.C0EPacketClickWindow.processPacket(C0EPacketClickWindow.java:113) ~[C0EPacketClickWindow.class:?]

at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241) ~[NetworkManager.class:?]

at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182) ~[NetworkSystem.class:?]

... 5 more

[16:03:38] [server thread/ERROR]: This crash report has been saved to: C:\Users\Srbislav\Desktop\Mihajlo\AntiCraft\eclipse\.\crash-reports\crash-2015-01-29_16.03.38-server.txt

[16:03:38] [server thread/INFO]: Stopping server

[16:03:38] [server thread/INFO]: Saving players

[16:03:38] [server thread/INFO]: Saving worlds

[16:03:38] [server thread/INFO]: Saving chunks for level 'AntiCraft Test'/Overworld

[16:03:38] [Client thread/INFO] [sTDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:388]: ---- Minecraft Crash Report ----

// Oh - I know what I did wrong!

 

Time: 1/29/15 4:03 PM

Description: Ticking memory connection

 

java.lang.NullPointerException: Ticking memory connection

at net.minecraft.entity.passive.EntityVillager.useRecipe(EntityVillager.java:395)

at net.minecraft.inventory.SlotMerchantResult.onPickupFromSlot(SlotMerchantResult.java:80)

at net.minecraft.inventory.Container.slotClick(Container.java:347)

at net.minecraft.network.NetHandlerPlayServer.processClickWindow(NetHandlerPlayServer.java:955)

at net.minecraft.network.play.client.C0EPacketClickWindow.processPacket(C0EPacketClickWindow.java:41)

at net.minecraft.network.play.client.C0EPacketClickWindow.processPacket(C0EPacketClickWindow.java:113)

at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241)

at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182)

at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726)

at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614)

at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118)

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485)

at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752)

 

 

A detailed walkthrough of the error, its code path and all known details is as follows:

---------------------------------------------------------------------------------------

 

-- Head --

Stacktrace:

at net.minecraft.entity.passive.EntityVillager.useRecipe(EntityVillager.java:395)

at net.minecraft.inventory.SlotMerchantResult.onPickupFromSlot(SlotMerchantResult.java:80)

at net.minecraft.inventory.Container.slotClick(Container.java:347)

at net.minecraft.network.NetHandlerPlayServer.processClickWindow(NetHandlerPlayServer.java:955)

at net.minecraft.network.play.client.C0EPacketClickWindow.processPacket(C0EPacketClickWindow.java:41)

at net.minecraft.network.play.client.C0EPacketClickWindow.processPacket(C0EPacketClickWindow.java:113)

at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241)

 

-- Ticking connection --

Details:

Connection: net.minecraft.network.NetworkManager@4148f7

Stacktrace:

at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182)

at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726)

at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614)

at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118)

at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485)

at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752)

 

-- System Details --

Details:

Minecraft Version: 1.7.10

Operating System: Windows 8.1 (x86) version 6.3

Java Version: 1.8.0_25, Oracle Corporation

Java VM Version: Java HotSpot Client VM (mixed mode), Oracle Corporation

Memory: 951427104 bytes (907 MB) / 1060372480 bytes (1011 MB) up to 1060372480 bytes (1011 MB)

JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used

IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0

FML: MCP v9.05 FML v7.10.85.1230 Minecraft Forge 10.13.2.1230 4 mods loaded, 4 mods active

mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

FML{7.10.85.1230} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.2.1230.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

Forge{10.13.2.1230} [Minecraft Forge] (forgeSrc-1.7.10-10.13.2.1230.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

anticraft{1.0} [§4AntiCraft] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

Profiler Position: N/A (disabled)

Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used

Player Count: 1 / 8; [EntityPlayerMP['Player209'/163, l='AntiCraft Test', x=-225.94, y=52.00, z=-653.29]]

Type: Integrated Server (map_client.txt)

Is Modded: Definitely; Client brand changed to 'fml,forge'

[16:03:38] [Client thread/INFO] [sTDOUT]: [net.minecraft.client.Minecraft:displayCrashReport:393]: #@!@# Game crashed! Crash report saved to: #@!@# .\crash-reports\crash-2015-01-29_16.03.38-server.txt

[16:03:38] [Client thread/INFO] [FML]: Waiting for the server to terminate/save.

[16:03:39] [server thread/INFO]: Saving chunks for level 'AntiCraft Test'/Nether

[16:03:39] [server thread/INFO]: Saving chunks for level 'AntiCraft Test'/The End

[16:03:39] [server thread/INFO] [FML]: Unloading dimension 0

[16:03:39] [server thread/INFO] [FML]: Unloading dimension -1

[16:03:39] [server thread/INFO] [FML]: Unloading dimension 1

[16:03:39] [server thread/INFO] [FML]: Applying holder lookups

[16:03:39] [server thread/INFO] [FML]: Holder lookups applied

[16:03:39] [server thread/INFO] [FML]: The state engine was in incorrect state SERVER_STOPPING and forced into state SERVER_STOPPED. Errors may have been discarded.

[16:03:39] [Client thread/INFO] [FML]: Server terminated.

AL lib: (EE) alc_cleanup: 1 device not closed

Java HotSpot Client VM warning: Using incremental CMS is deprecated and will likely be removed in a future release

 

 

_         

___ ___| |__  _ __ 

/ __/ __| '_ \| '_ \

\__ \__ \ | | | | | |

|___/___/_| |_|_| |_|

Link to comment
Share on other sites

Not sure why the crash, but I am noticing that

addDefaultEquipmentAndRecipies

does nothing.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Your problem is that you are extending EntityVillager, but buyingList and addDefaultEquipment are both PRIVATE members of EntityVillager - you cannot use or override them without Reflection or ASM.

 

What you can do, however, is override getRecipes to return your own list, but because you override EntityVillager, your mob is still using the villager's buyingList (which is NULL) when useRecipe or any other villager method is called.

 

You either have to override every method from EntityVillager which interacts with buyingList and make it use your own list, or you need to not extend EntityVillager and just implement IMerchant instead.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.