Jump to content

[1.7.2] [solved] replacing existing mobs/entities with custom ones


Recommended Posts

Posted

in the past versions, i was able to do that simply by overwriting a mob through its id, so for example if i registered a mob that uses the same name/id as cave spider, it would replace the cave spider and spawn anytime the game tried to spawn the spider, effectively replacing it completely.

 

in 1.7.2 it's no longer possible, trying to do that causes a crash.

 

 

java.lang.IllegalArgumentException: ID is already registered: CaveSpider

at net.minecraft.entity.EntityList.addMapping(EntityList.java:96)

at cpw.mods.fml.common.registry.EntityRegistry.registerGlobalEntityID(EntityRegistry.java:199)

at yarrmateys.yarrCuteMobModels.YarrCuteMobModels.load(YarrCuteMobModels.java:229)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:536)

at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

at com.google.common.eventbus.EventBus.post(EventBus.java:267)

at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:209)

at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:188)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47)

at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)

at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

at com.google.common.eventbus.EventBus.post(EventBus.java:267)

at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119)

at cpw.mods.fml.common.Loader.initializeMods(Loader.java:676)

at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:260)

at net.minecraft.client.Minecraft.startGame(Minecraft.java:556)

at net.minecraft.client.Minecraft.run(Minecraft.java:850)

at net.minecraft.client.main.Main.main(Main.java:103)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

 

 

the code i used to use was

Entity var3 = EntityList.createEntityByName("CaveSpider", (World)null);

EntityRegistry.registerGlobalEntityID(EntityCMMCaveSpider.class, "CaveSpider", EntityList.getEntityID(var3));

 

assuming it's by design, either by mojang or forge team, is it possible to do this in a different way that doesn't require a coremod?

Posted

while i did manage to make it spawn a different mob, i found a few extra problems.

 

on spawning it'd spawn two entities. one real, one ghost one that doesn't do anything.

 

then i couldn't get it to differentiate between spider and cave spider. it activated for both spawn eggs when i referenced entityspider.

 

import net.minecraft.entity.monster.EntityCreeper;
import net.minecraft.entity.monster.EntitySpider;
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;

public class CMMEventHandler {
@SubscribeEvent
    public void OnEntityJoinWorld(EntityJoinWorldEvent event) 
    {
    	if (event.entity instanceof EntitySpider)
    	{
    		EntityCreeper spawnEntity = new EntityCreeper(event.world);
    		spawnEntity.setPosition(event.entity.posX, event.entity.posY, event.entity.posZ);
    		System.out.println("test");
    		event.entity.setDead();
    		event.world.spawnEntityInWorld(spawnEntity);
    	}
    }
}

Posted

it mostly seems to be working now, although i got hit by a crash when trying to replace existing mobs with any of my own.

 

i had to use full path to the class for it to work though (event.entity.getClass() == net.minecraft.entity.monster.EntityCaveSpider.class), just the EntityCaveSpider.class by itself didn't seem do to anything.

 

[spoiler=crash-2014-02-08_19.47.22-client.txt]---- Minecraft Crash Report ----

// Hey, that tickles! Hehehe!

 

Time: 2/8/14 7:47 PM

Description: Unexpected error

 

java.lang.NullPointerException: Unexpected error

at net.minecraft.client.network.NetHandlerPlayClient.handleSpawnMob(NetHandlerPlayClient.java:766)

at net.minecraft.network.play.server.S0FPacketSpawnMob.processPacket(S0FPacketSpawnMob.java:97)

at net.minecraft.network.play.server.S0FPacketSpawnMob.processPacket(S0FPacketSpawnMob.java:15)

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

at net.minecraft.client.multiplayer.PlayerControllerMP.updateController(PlayerControllerMP.java:294)

at net.minecraft.client.Minecraft.runTick(Minecraft.java:1586)

at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:952)

at net.minecraft.client.Minecraft.run(Minecraft.java:870)

at net.minecraft.client.main.Main.main(Main.java:103)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

 

 

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

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

 

-- Head --

Stacktrace:

at net.minecraft.client.network.NetHandlerPlayClient.handleSpawnMob(NetHandlerPlayClient.java:766)

at net.minecraft.network.play.server.S0FPacketSpawnMob.processPacket(S0FPacketSpawnMob.java:97)

at net.minecraft.network.play.server.S0FPacketSpawnMob.processPacket(S0FPacketSpawnMob.java:15)

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

at net.minecraft.client.multiplayer.PlayerControllerMP.updateController(PlayerControllerMP.java:294)

 

-- Affected level --

Details:

Level name: MpServer

All players: 1 total; [EntityClientPlayerMP['Player964'/332, l='MpServer', x=2.99, y=94.62, z=-0.20]]

Chunk stats: MultiplayerChunkCache: 225, 225

Level seed: 0

Level generator: ID 00 - default, ver 1. Features enabled: false

Level generator options:

Level spawn location: World: (112,64,252), Chunk: (at 0,4,12 in 7,15; contains blocks 112,0,240 to 127,255,255), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)

Level time: 79593 game time, 9571 day time

Level dimension: 0

Level storage version: 0x00000 - Unknown?

Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)

Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false

Forced entities: 187 total; [EntityChicken['Chicken'/0, l='MpServer', x=-65.50, y=70.00, z=59.50], EntityChicken['Chicken'/550, l='MpServer', x=25.03, y=71.00, z=15.69], EntityChicken['Chicken'/1, l='MpServer', x=-67.19, y=71.00, z=62.56], EntityCreeper['Creeper'/551, l='MpServer', x=27.16, y=37.00, z=17.69], EntityChicken['Chicken'/2, l='MpServer', x=-66.50, y=70.00, z=63.50], EntityCreeper['Creeper'/548, l='MpServer', x=18.94, y=38.00, z=15.44], EntityChicken['Chicken'/3, l='MpServer', x=-64.69, y=72.00, z=54.09], EntityCreeper['Creeper'/549, l='MpServer', x=28.69, y=37.00, z=15.31], EntityChicken['Chicken'/4, l='MpServer', x=-64.50, y=70.00, z=65.50], EntityItem['item.tile.sapling.oak'/546, l='MpServer', x=26.69, y=80.13, z=-13.31], EntityChicken['Chicken'/5, l='MpServer', x=-68.84, y=73.00, z=67.59], EntityItem['item.tile.sapling.jungle'/547, l='MpServer', x=19.59, y=88.13, z=-13.28], EntityItem['item.tile.sapling.oak'/544, l='MpServer', x=26.88, y=78.13, z=-7.44], EntityItem['item.tile.sapling.oak'/545, l='MpServer', x=24.13, y=73.13, z=-8.25], EntityItem['item.item.seeds'/558, l='MpServer', x=40.13, y=24.13, z=-19.28], EntityChicken['Chicken'/9, l='MpServer', x=-57.53, y=71.00, z=58.53], EntityItem['item.tile.sapling.oak'/559, l='MpServer', x=40.13, y=72.13, z=-7.88], EntityChicken['Chicken'/10, l='MpServer', x=-58.34, y=70.00, z=62.53], EntityZombie['Zombie'/557, l='MpServer', x=42.00, y=13.00, z=-69.56], EntityChicken['Chicken'/11, l='MpServer', x=-52.50, y=71.00, z=51.50], EntityChicken['Chicken'/12, l='MpServer', x=-51.50, y=71.00, z=52.50], EntityChicken['Chicken'/13, l='MpServer', x=-53.50, y=72.00, z=49.50], EntityChicken['Chicken'/14, l='MpServer', x=-49.44, y=72.00, z=53.56], EntitySkeleton['Skeleton'/552, l='MpServer', x=29.50, y=37.00, z=16.50], EntitySkeleton['Skeleton'/553, l='MpServer', x=27.78, y=37.00, z=16.16], EntitySkeleton['Skeleton'/565, l='MpServer', x=39.50, y=58.00, z=11.87], EntityItem['item.tile.sapling.oak'/564, l='MpServer', x=38.75, y=77.13, z=-11.37], EntityChicken['Chicken'/21, l='MpServer', x=-38.50, y=73.00, z=61.50], EntityItem['item.tile.sapling.oak'/563, l='MpServer', x=46.69, y=74.13, z=-13.22], EntityItem['item.tile.sapling.oak'/562, l='MpServer', x=47.03, y=74.13, z=-10.13], EntityChicken['Chicken'/23, l='MpServer', x=-34.66, y=72.00, z=56.03], EntityItem['item.tile.sapling.oak'/561, l='MpServer', x=44.28, y=75.13, z=-11.13], EntityChicken['Chicken'/22, l='MpServer', x=-36.03, y=72.00, z=59.31], EntityItem['item.tile.sapling.oak'/560, l='MpServer', x=45.13, y=75.13, z=-10.34], EntityChicken['Chicken'/25, l='MpServer', x=-43.16, y=72.00, z=79.84], EntityCreeper['Creeper'/575, l='MpServer', x=53.50, y=31.00, z=-29.50], EntityChicken['Chicken'/24, l='MpServer', x=-37.59, y=73.00, z=79.78], EntityItem['item.item.reeds'/574, l='MpServer', x=55.72, y=64.13, z=-46.66], EntityItem['item.item.reeds'/573, l='MpServer', x=54.59, y=64.13, z=-45.41], EntityCreeper['Creeper'/572, l='MpServer', x=53.53, y=24.00, z=-33.50], EntityItem['item.tile.sapling.oak'/571, l='MpServer', x=52.72, y=75.13, z=-63.09], EntityChicken['Chicken'/31, l='MpServer', x=-27.31, y=70.00, z=68.38], EntityChicken['Chicken'/30, l='MpServer', x=-23.63, y=73.00, z=79.53], EntitySpider['Spider'/512, l='MpServer', x=12.47, y=38.00, z=15.91], EntitySkeleton['Skeleton'/513, l='MpServer', x=0.50, y=41.00, z=26.21], EntityChicken['Chicken'/39, l='MpServer', x=-0.19, y=66.00, z=62.66], EntitySkeleton['Skeleton'/524, l='MpServer', x=30.50, y=16.00, z=-80.50], EntityItem['item.tile.sapling.oak'/42, l='MpServer', x=-13.44, y=74.13, z=61.88], EntityZombie['Zombie'/313, l='MpServer', x=-0.50, y=43.00, z=34.84], EntityCreeper['Creeper'/525, l='MpServer', x=26.50, y=16.00, z=-76.44], EntityCreeper['Creeper'/526, l='MpServer', x=26.34, y=16.00, z=-78.66], EntityItem['item.tile.sapling.oak'/40, l='MpServer', x=-14.84, y=67.13, z=58.13], EntitySkeleton['Skeleton'/315, l='MpServer', x=-0.44, y=42.00, z=33.22], EntitySkeleton['Skeleton'/314, l='MpServer', x=-0.34, y=43.00, z=37.09], EntityItem['item.tile.sapling.oak'/41, l='MpServer', x=-14.19, y=67.13, z=59.88], EntityZombie['Zombie'/317, l='MpServer', x=26.50, y=45.00, z=38.69], EntityZombie['Zombie'/316, l='MpServer', x=7.00, y=43.00, z=37.63], EntityBat['Bat'/319, l='MpServer', x=25.16, y=45.04, z=36.84], EntityWitch['Witch'/318, l='MpServer', x=34.33, y=48.00, z=43.04], EntityItem['item.tile.sapling.oak'/533, l='MpServer', x=24.88, y=83.13, z=-51.97], EntityItem['item.tile.sapling.oak'/532, l='MpServer', x=16.41, y=84.13, z=-53.59], EntityItem['item.tile.sapling.oak'/535, l='MpServer', x=31.38, y=80.13, z=-51.13], EntityItem['item.tile.sapling.oak'/534, l='MpServer', x=19.75, y=82.13, z=-52.03], EntityZombie['Zombie'/529, l='MpServer', x=24.50, y=16.00, z=-75.50], EntitySkeleton['Skeleton'/528, l='MpServer', x=31.34, y=16.00, z=-76.30], EntityZombie['Zombie'/531, l='MpServer', x=24.75, y=16.00, z=-77.41], EntityZombie['Zombie'/530, l='MpServer', x=30.92, y=16.00, z=-75.43], EntityItem['item.tile.sapling.oak'/541, l='MpServer', x=23.78, y=67.13, z=-18.38], EntityItem['item.tile.sapling.oak'/540, l='MpServer', x=31.13, y=74.13, z=-17.25], EntityItem['item.tile.sapling.oak'/543, l='MpServer', x=26.13, y=78.13, z=-9.88], EntityBat['Bat'/56, l='MpServer', x=15.75, y=43.10, z=49.84], EntityItem['item.item.apple'/542, l='MpServer', x=24.88, y=79.13, z=-10.00], EntityItem['item.tile.sapling.oak'/537, l='MpServer', x=25.13, y=82.13, z=-54.59], EntityItem['item.tile.sapling.oak'/536, l='MpServer', x=18.28, y=83.13, z=-57.44], EntityItem['item.tile.sapling.oak'/539, l='MpServer', x=28.13, y=75.13, z=-44.13], EntityItem['item.tile.sapling.oak'/538, l='MpServer', x=24.63, y=75.13, z=-34.50], EntityZombie['Zombie'/68, l='MpServer', x=27.66, y=48.00, z=48.50], EntityOcelot['Ocelot'/69, l='MpServer', x=30.50, y=70.00, z=62.86], EntityZombie['Zombie'/70, l='MpServer', x=24.28, y=21.00, z=66.84], EntityCreeper['Creeper'/71, l='MpServer', x=20.50, y=21.00, z=71.50], EntityBat['Bat'/64, l='MpServer', x=24.47, y=44.73, z=59.41], EntityZombie['Zombie'/65, l='MpServer', x=27.41, y=42.00, z=59.09], EntityZombie['Zombie'/66, l='MpServer', x=23.91, y=42.00, z=63.25], EntityCreeper['Creeper'/67, l='MpServer', x=20.53, y=43.00, z=59.00], EntityCreeper['Creeper'/72, l='MpServer', x=26.50, y=21.00, z=70.50], EntityZombie['Zombie'/73, l='MpServer', x=31.69, y=42.00, z=66.47], EntityBat['Bat'/74, l='MpServer', x=31.43, y=41.79, z=69.28], EntityChicken['Chicken'/75, l='MpServer', x=31.50, y=71.00, z=71.50], EntitySkeleton['Skeleton'/326, l='MpServer', x=34.50, y=47.00, z=41.49], EntityZombie['Zombie'/327, l='MpServer', x=32.50, y=47.00, z=43.50], EntityChicken['Chicken'/87, l='MpServer', x=36.53, y=72.00, z=71.13], EntitySkeleton['Skeleton'/324, l='MpServer', x=37.22, y=47.00, z=38.31], EntityCreeper['Creeper'/325, l='MpServer', x=37.50, y=45.00, z=34.34], EntityBat['Bat'/322, l='MpServer', x=29.56, y=50.10, z=43.16], EntityZombie['Zombie'/323, l='MpServer', x=30.91, y=48.00, z=47.91], EntityCreeper['Creeper'/320, l='MpServer', x=29.78, y=48.00, z=45.09], EntityCreeper['Creeper'/321, l='MpServer', x=29.56, y=48.00, z=46.00], EntityCreeper['Creeper'/333, l='MpServer', x=10.50, y=40.00, z=-6.50], EntityBat['Bat'/330, l='MpServer', x=31.91, y=49.85, z=38.31], EntityBat['Bat'/331, l='MpServer', x=55.00, y=46.51, z=42.31], EntityBat['Bat'/328, l='MpServer', x=34.75, y=46.14, z=25.47], EntityWitch['Witch'/329, l='MpServer', x=34.69, y=48.00, z=42.27], EntityChicken['Chicken'/576, l='MpServer', x=62.50, y=73.00, z=26.50], EntityChicken['Chicken'/577, l='MpServer', x=59.50, y=72.00, z=28.50], EntityBat['Bat'/578, l='MpServer', x=76.22, y=14.98, z=-44.78], EntityCreeper['Creeper'/579, l='MpServer', x=78.69, y=15.00, z=-36.38], EntityChicken['Chicken'/580, l='MpServer', x=76.91, y=63.00, z=-24.47], EntityBat['Bat'/98, l='MpServer', x=58.44, y=43.39, z=50.48], EntitySkeleton['Skeleton'/99, l='MpServer', x=63.50, y=25.00, z=69.50], EntityChicken['Chicken'/581, l='MpServer', x=72.50, y=66.00, z=-16.50], EntityChicken['Chicken'/582, l='MpServer', x=74.50, y=67.00, z=-16.50], EntityChicken['Chicken'/583, l='MpServer', x=75.13, y=64.00, z=-20.47], EntityZombie['Zombie'/97, l='MpServer', x=63.50, y=39.00, z=54.50], EntityChicken['Chicken'/584, l='MpServer', x=72.50, y=66.00, z=-14.50], EntityChicken['Chicken'/585, l='MpServer', x=72.50, y=66.00, z=-14.50], EntityChicken['Chicken'/586, l='MpServer', x=68.50, y=68.00, z=12.50], EntityChicken['Chicken'/588, l='MpServer', x=68.69, y=88.00, z=13.47], EntityZombie['Zombie'/119, l='MpServer', x=66.50, y=52.00, z=52.09], EntityClientPlayerMP['Player964'/332, l='MpServer', x=2.99, y=94.62, z=-0.20], EntityBat['Bat'/594, l='MpServer', x=81.83, y=14.00, z=-41.66], EntityBat['Bat'/116, l='MpServer', x=62.59, y=36.61, z=63.72], EntityChicken['Chicken'/596, l='MpServer', x=80.38, y=66.00, z=-22.38], EntitySquid['Squid'/440, l='MpServer', x=-51.50, y=56.17, z=-28.50], EntitySquid['Squid'/441, l='MpServer', x=-54.28, y=56.00, z=-27.53], EntitySquid['Squid'/442, l='MpServer', x=-50.71, y=56.19, z=-23.32], EntityZombie['Zombie'/443, l='MpServer', x=-58.25, y=18.00, z=12.50], EntityCreeper['Creeper'/444, l='MpServer', x=-62.50, y=18.00, z=12.50], EntityCreeper['Creeper'/445, l='MpServer', x=-58.50, y=18.00, z=10.50], EntityItem['item.tile.sapling.oak'/446, l='MpServer', x=-49.69, y=89.13, z=15.13], EntityBat['Bat'/447, l='MpServer', x=-51.53, y=17.04, z=32.03], EntityChicken['Chicken'/432, l='MpServer', x=-68.53, y=72.00, z=19.34], EntityBat['Bat'/427, l='MpServer', x=-77.44, y=29.08, z=-0.28], EntityZombie['Zombie'/428, l='MpServer', x=-66.50, y=20.00, z=8.50], EntityZombie['Zombie'/430, l='MpServer', x=-73.69, y=16.00, z=21.56], EntitySquid['Squid'/479, l='MpServer', x=-26.93, y=59.34, z=-37.25], EntityChicken['Chicken'/476, l='MpServer', x=-19.50, y=67.00, z=-78.50], EntityChicken['Chicken'/477, l='MpServer', x=-23.50, y=64.00, z=-75.50], EntitySpider['Spider'/474, l='MpServer', x=-20.19, y=38.00, z=-70.91], EntitySpider['Spider'/475, l='MpServer', x=-18.72, y=38.00, z=-72.72], EntityChicken['Chicken'/473, l='MpServer', x=-19.50, y=68.00, z=-80.50], EntityItem['item.tile.sapling.oak'/468, l='MpServer', x=-44.13, y=91.13, z=24.88], EntityItem['item.tile.sapling.oak'/469, l='MpServer', x=-43.13, y=83.13, z=39.34], EntitySkeleton['Skeleton'/466, l='MpServer', x=-33.44, y=21.00, z=12.94], EntityBat['Bat'/467, l='MpServer', x=-37.59, y=21.16, z=21.25], EntitySquid['Squid'/464, l='MpServer', x=-32.83, y=60.46, z=-24.39], EntitySquid['Squid'/465, l='MpServer', x=-37.83, y=59.40, z=-12.74], EntitySquid['Squid'/463, l='MpServer', x=-47.16, y=56.25, z=-24.36], EntitySquid['Squid'/462, l='MpServer', x=-35.31, y=60.34, z=-23.67], EntitySquid['Squid'/461, l='MpServer', x=-43.59, y=59.33, z=-17.50], EntitySquid['Squid'/460, l='MpServer', x=-33.49, y=59.23, z=-20.13], EntitySquid['Squid'/459, l='MpServer', x=-45.95, y=56.00, z=-24.50], EntitySquid['Squid'/458, l='MpServer', x=-36.57, y=60.38, z=-22.31], EntitySquid['Squid'/457, l='MpServer', x=-46.09, y=58.40, z=-20.20], EntitySquid['Squid'/456, l='MpServer', x=-41.50, y=58.31, z=-23.50], EntitySquid['Squid'/455, l='MpServer', x=-43.19, y=59.00, z=-26.50], EntityItem['item.tile.sapling.oak'/454, l='MpServer', x=-47.13, y=76.13, z=-47.88], EntityItem['item.tile.sapling.oak'/453, l='MpServer', x=-44.13, y=76.13, z=-51.03], EntityItem['item.tile.sapling.oak'/452, l='MpServer', x=-45.88, y=69.13, z=-54.88], EntitySkeleton['Skeleton'/451, l='MpServer', x=-36.50, y=49.00, z=-49.50], EntityWitch['Witch'/450, l='MpServer', x=-37.50, y=42.00, z=-67.50], EntityZombie['Zombie'/508, l='MpServer', x=3.02, y=40.00, z=23.85], EntityZombie['Zombie'/509, l='MpServer', x=5.56, y=39.00, z=20.53], EntityZombie['Zombie'/510, l='MpServer', x=5.44, y=40.00, z=26.49], EntitySkeleton['Skeleton'/511, l='MpServer', x=6.56, y=40.00, z=22.84], EntityItem['item.tile.sapling.oak'/504, l='MpServer', x=5.53, y=70.13, z=0.63], EntityCreeper['Creeper'/505, l='MpServer', x=2.50, y=25.00, z=30.50], EntityZombie['Zombie'/506, l='MpServer', x=4.63, y=41.00, z=17.94], EntitySPrinny['Prinny X'/507, l='MpServer', x=3.41, y=41.00, z=19.91], EntityItem['item.tile.sapling.jungle'/501, l='MpServer', x=5.13, y=64.13, z=-23.63], EntitySPrinny['Prinny X'/502, l='MpServer', x=8.50, y=39.00, z=13.50], EntityCreeper['Creeper'/503, l='MpServer', x=13.50, y=41.00, z=6.50], EntitySquid['Squid'/496, l='MpServer', x=-11.53, y=56.03, z=-7.46], EntityItem['item.tile.sapling.jungle'/497, l='MpServer', x=-10.88, y=75.13, z=11.47], EntitySquid['Squid'/493, l='MpServer', x=-7.40, y=61.19, z=-16.51], EntitySquid['Squid'/495, l='MpServer', x=-12.50, y=58.37, z=-5.52], EntitySquid['Squid'/494, l='MpServer', x=-9.45, y=60.39, z=-10.96], EntitySquid['Squid'/489, l='MpServer', x=-34.31, y=60.32, z=-10.82], EntitySquid['Squid'/488, l='MpServer', x=-18.50, y=56.00, z=-8.50], EntitySquid['Squid'/490, l='MpServer', x=-27.06, y=58.07, z=-14.45], EntitySquid['Squid'/485, l='MpServer', x=-16.46, y=60.00, z=-2.50], EntitySquid['Squid'/484, l='MpServer', x=-19.29, y=57.83, z=-10.40], EntitySquid['Squid'/487, l='MpServer', x=-26.95, y=58.34, z=-9.81], EntitySquid['Squid'/486, l='MpServer', x=-16.95, y=60.35, z=-14.50], EntitySquid['Squid'/481, l='MpServer', x=-26.47, y=57.61, z=-15.53], EntitySquid['Squid'/480, l='MpServer', x=-21.66, y=56.09, z=-29.95], EntitySquid['Squid'/483, l='MpServer', x=-25.50, y=56.36, z=-11.43], EntitySquid['Squid'/482, l='MpServer', x=-20.79, y=58.35, z=-11.50]]

Retry entities: 0 total; []

Server brand: fml,forge

Server type: Integrated singleplayer server

Stacktrace:

at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:384)

at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2432)

at net.minecraft.client.Minecraft.run(Minecraft.java:899)

at net.minecraft.client.main.Main.main(Main.java:103)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)

at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

 

-- System Details --

Details:

Minecraft Version: 1.7.2

Operating System: Windows 7 (amd64) version 6.1

Java Version: 1.7.0_51, Oracle Corporation

Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation

Memory: 655497312 bytes (625 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)

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

AABB Pool Size: 15854 (887824 bytes; 0 MB) allocated, 6814 (381584 bytes; 0 MB) used

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

FML: MCP v9.01-pre FML v7.2.116.1025 Minecraft Forge 10.12.0.1025 7 mods loaded, 7 mods active

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

FML{7.2.116.1025} [Forge Mod Loader] (forgeBin-1.7.2-10.12.0.1025.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

Forge{10.12.0.1025} [Minecraft Forge] (forgeBin-1.7.2-10.12.0.1025.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

examplemod{1.0} [Example Mod] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

yarrmateys_recipes{1.7.X} [yarrRecipeTweaks] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

yarrmateys_mobs{1.7.X} [yarrPrivate] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

yarr_cutemobmodels{1.7.X} [Cute Mob Models ] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available

Launched Version: 1.6

LWJGL: 2.9.0

OpenGL: GeForce GTS 450/PCIe/SSE2 GL version 4.3.0, NVIDIA Corporation

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

Type: Client (map_client.txt)

Resource Packs: []

Current Language: English (US)

Profiler Position: N/A (disabled)

Vec3 Pool Size: 14478 (810768 bytes; 0 MB) allocated, 6397 (358232 bytes; 0 MB) used

Anisotropic Filtering: On (16)

 

Posted

[spoiler=CMMEventHandler]

public class CMMEventHandler

{

@SubscribeEvent

    public void OnEntityJoinWorld(EntityJoinWorldEvent event)

    {

if(!event.world.isRemote)

{

    if (event.entity.getClass() == net.minecraft.entity.monster.EntityGhast.class)

    {

    EntityCMMGhast spawnEntity = new EntityCMMGhast(event.world);

    spawnEntity.setPosition(event.entity.posX, event.entity.posY, event.entity.posZ);

    spawnEntity.setAngles(event.entity.rotationPitch, event.entity.rotationYaw);

    event.world.spawnEntityInWorld(spawnEntity);

    event.entity.setDead();

    }

    }

    }

}

 

 

 

[spoiler=EntityCMMGhast]

public class EntityCMMGhast extends EntityGhast

{

    public EntityCMMGhast(World var1)

    {

        super(var1);

        if (YarrCuteMobModels.GhastUseAccurateHitbox && YarrCuteMobModels.GhastUseAccurateModelSize == false)

            this.setSize(0.6F, 1.8F);

        else

        this.setSize(4.0F, 4.0F);

    }

 

    /**

    * Called to update the entity's position/logic.

    */

    public void onUpdate()

    {

        super.onUpdate();

        byte var1 = this.dataWatcher.getWatchableObjectByte(16);

    }

}

 

 

[spoiler=RenderCMMGhast]public class RenderCMMGhast extends RenderLiving

{

    private static final ResourceLocation texture1 = new ResourceLocation("yarrcutemobmodels:textures/Ghast1.png");

    private static final ResourceLocation texture2 = new ResourceLocation("yarrcutemobmodels:textures/Ghast2.png");

protected ModelCMMGhast cuteModel;

 

public RenderCMMGhast()

{

    super(new ModelCMMGhast(), 1.0F);

    this.setRenderPassModel(new ModelCMMGhast());

}

 

public RenderCMMGhast (ModelCMMGhast modelCMM, float f)

{

super(modelCMM, f);

cuteModel = ((ModelCMMGhast)mainModel);

}

 

    /**

    * Updates ghast scale in prerender callback

    */

    protected void updateGhastScale(EntityGhast par1EntityGhast, float par2)

    {

    if (YarrCuteMobModels.GhastUseAccurateModelSize == true) {

    float f1 = 2.00F;

        float f2 = 2.00F;

        float f3 = 2.00F;

GL11.glScalef(f1, f2, f3);

    }

        else {

    float f1 = 1.0F;

        float f2 = 1.0F;

        float f3 = 1.0F;

GL11.glScalef(f1, f2, f3);

    }

    }

 

    /**

    * Pre-Renders the Ghast.

    */

    protected void preRenderGhast(EntityGhast par1EntityGhast, float par2)

    {

        float f1 = ((float)par1EntityGhast.prevAttackCounter + (float)(par1EntityGhast.attackCounter - par1EntityGhast.prevAttackCounter) * par2) / 20.0F;

 

        if (f1 < 0.0F)

        {

            f1 = 0.0F;

        }

 

        f1 = 1.0F / (f1 * f1 * f1 * f1 * f1 * 2.0F + 1.0F);

        float f2 = (8.0F + f1) / 2.0F;

        float f3 = (8.0F + 1.0F / f1) / 2.0F;

        GL11.glScalef(f3, f2, f3);

        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

    }

 

    /**

    * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:

    * entityLiving, partialTickTime

    */

    protected void preRenderCallback(EntityLivingBase par1EntityLivingBase, float par2)

    {

        this.updateGhastScale((EntityGhast)par1EntityLivingBase, par2);

    }

 

public void renderYarrmateys(EntityGhast entity, double par2, double par4, double par6, float par8, float par9)

    {

        this.cuteModel.isOnLadder = entity.isOnLadder();

        this.cuteModel.onGround = entity.onGround;

        this.cuteModel.inWater = entity.isInWater();

        this.cuteModel.inWater2 = entity.isPushedByWater();

        super.doRender(entity, par2, par4, par6, par8, par9);

    }

 

public void doRenderLiving(EntityLivingBase par1EntityLivingBase, double par2, double par4, double par6, float par8, float par9)

    {

        renderYarrmateys((EntityGhast)par1EntityLivingBase, par2, par4, par6, par8, par9);

    }

 

public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9)

    {

        renderYarrmateys((EntityGhast)par1Entity, par2, par4, par6, par8, par9);

    }

 

    protected ResourceLocation func_110867_a(EntityGhast par1EntityGhast)

    {

        return par1EntityGhast.func_110182_bF() ? texture2 : texture1;

    }

 

    @Override

    protected ResourceLocation getEntityTexture(Entity par1Entity)

    {

        return this.func_110867_a((EntityGhast)par1Entity);

    }

}

 

 

 

not sure if this one's needed too or not, but

[spoiler=main mod file]

@Mod(modid = YarrCuteMobModels.MODID, version = YarrCuteMobModels.VERSION, name = YarrCuteMobModels.NAME)

public class YarrCuteMobModels

{

    public static final String MODID = "yarr_cutemobmodels";

    public static final String NAME = "Cute Mob Models";

    public static final String VERSION = "1.7.X";

 

    @Instance("yarrCuteMobModels")

public static YarrCuteMobModels instance = new YarrCuteMobModels();

 

@SidedProxy(clientSide = "yarrmateys.yarrCuteMobModels.CMMClientProxy", serverSide = "yarrmateys.yarrCuteMobModels.CMMCommonProxy")

public static CMMCommonProxy proxy;

 

public static boolean enableMod;

static int startEntityId;

 

    public static boolean CreeperReplaceModel;

   

    public static boolean SkeletonReplaceModel;

public static boolean SkeletonAimedBow;

   

    public static boolean EndermanReplaceModel;

 

    public static boolean WitchReplaceModel;

 

public static boolean SpiderReplaceModel;

public static boolean SpiderUseAccurateHitbox;

 

public static boolean CaveSpiderReplaceModel;

public static boolean CaveSpiderUseAccurateHitbox;

 

    public static boolean ZombieReplaceModel;

public static boolean ZombieExtendedHands;

 

    public static boolean PigZombieReplaceModel;

public static boolean PigZombieExtendedHands;

   

    public static boolean GhastReplaceModel;

    public static boolean GhastUseAccurateModelSize;

    public static boolean GhastUseAccurateHitbox;

 

    public static boolean GhastSSpawnGhastSister;

    public static boolean GhastSBrutalGhastSister;

   

    public static boolean BlazeReplaceModel;

    public static boolean BlazeHideBlazeRods;

public static boolean BlazeHideSmokeParticles;

 

public static boolean SilverfishReplaceModel;

public static boolean SilverfishUseAccurateHitbox;

public static boolean SilverfishUseAccurateModelSize;

 

public static boolean IronGolemReplaceModel;

public static boolean IronGolemUseAccurateHitbox;

public static boolean IronGolemUseAccurateModelSize;

 

public static boolean SnowGolemReplaceModel;

 

public static boolean SlimeReplaceModel;

public static boolean SlimeUseAccurateHitbox;

public static boolean SlimeUseAccurateModelSize;

 

public static boolean MagmaCubeReplaceModel;

public static boolean MagmaCubeUseAccurateHitbox;

public static boolean MagmaCubeUseAccurateModelSize;

 

public static boolean VillagerReplaceModel;

 

    public static boolean WolfReplaceModel;

 

    @EventHandler

public void PreInit(FMLPreInitializationEvent event)

    {

        Configuration config = new Configuration(event.getSuggestedConfigurationFile());

 

        config.load();

 

        enableMod = config.get(Configuration.CATEGORY_GENERAL, "enableMod", true, "This will turn most of the mod on or off. Everything but the Ghast Sister's rendering will be disabled if it's off.").getBoolean(true);

        startEntityId = config.get(Configuration.CATEGORY_GENERAL, "startEntityId", 300, "This will change the ID number for Ghast Sister/GhastS enemy. Default 300.").getInt(300);

       

    BlazeReplaceModel = config.get(Configuration.CATEGORY_GENERAL, "BlazeReplaceModel", true, "This will change the Blaze model into the mobtalker design.").getBoolean(true);

    BlazeHideBlazeRods = config.get(Configuration.CATEGORY_GENERAL, "BlazeHideBlazeRods", false, "This will hide the blaze rods floating around Blaze.").getBoolean(false);

    BlazeHideSmokeParticles = config.get(Configuration.CATEGORY_GENERAL, "BlazeHideSmokeParticle", true, "This will hide the smoke particles appearing around Blaze.").getBoolean(true);

 

        CreeperReplaceModel = config.get(Configuration.CATEGORY_GENERAL, "CreeperReplaceModel", true, "This will change the Creeper model into the mobtalker design.").getBoolean(true);

 

        CaveSpiderReplaceModel = config.get(Configuration.CATEGORY_GENERAL, "CaveSpiderReplaceModel", true, "This will change the Cave Spider model into the mobtalker design.").getBoolean(true);

        CaveSpiderUseAccurateHitbox = config.get(Configuration.CATEGORY_GENERAL, "CaveSpiderUseAccurateHitbox", false, "This will adjust the Cave Spider's hitbox to match model's size.").getBoolean(false);

   

        EndermanReplaceModel = config.get(Configuration.CATEGORY_GENERAL, "EndermanReplaceModel", true, "This will change the Enderman model into the mobtalker design.").getBoolean(true);

 

    GhastReplaceModel = config.get(Configuration.CATEGORY_GENERAL, "GhastReplaceModel", true, "This will change the Ghast model into the mobtalker design.").getBoolean(true);

    GhastUseAccurateModelSize = config.get(Configuration.CATEGORY_GENERAL, "GhastUseAccurateModelSize", false, "This will adjust the Ghast's size to match the hitbox's size.").getBoolean(false);

    GhastUseAccurateHitbox = config.get(Configuration.CATEGORY_GENERAL, "GhastuseAccurateHitbox", false, "This will adjust the Ghast's hitbox to match model's size.").getBoolean(false);

 

    GhastSSpawnGhastSister = config.get(Configuration.CATEGORY_GENERAL, "GhastSSpawnGhastSister", true, "This will allow spawning of the Ghast Sister mob.").getBoolean(true);

    GhastSBrutalGhastSister = config.get(Configuration.CATEGORY_GENERAL, "GhastSBrutalGhastSister", true, "This will make the Ghast Sister mob more difficult.").getBoolean(true);

 

    IronGolemReplaceModel = config.get(Configuration.CATEGORY_GENERAL, "IronGolemReplaceModel", true, "This will change the Iron Golem model into the mobtalker design.").getBoolean(true);

    IronGolemUseAccurateHitbox = config.get(Configuration.CATEGORY_GENERAL, "IronGolemUseAccurateHitbox", false, "This will adjust the Iron Golem's hitbox to match model's size.").getBoolean(false);

    IronGolemUseAccurateModelSize = config.get(Configuration.CATEGORY_GENERAL, "IronGolemUseAccurateModelSize", false, "This will adjust the Iron Golem's size to match the hitbox's size.").getBoolean(false);

 

        PigZombieReplaceModel = config.get(Configuration.CATEGORY_GENERAL, "PigZombieReplaceModel", true, "This will change the Zombie Pigman model into the mobtalker design.").getBoolean(true);

    PigZombieExtendedHands = config.get(Configuration.CATEGORY_GENERAL, "PigZombieExtendedHands", true, "This will make Zombie Pigman extend its arms forward.").getBoolean(true);

 

    SilverfishReplaceModel = config.get(Configuration.CATEGORY_GENERAL, "SilverfishReplaceModel", true, "This will change the Silverfish model into the mobtalker design.").getBoolean(true);

    SilverfishUseAccurateHitbox = config.get(Configuration.CATEGORY_GENERAL, "SilverfishUseAccurateHitbox", false, "This will adjust the Silverfish's hitbox to match model's size.").getBoolean(false);

    SilverfishUseAccurateModelSize = config.get(Configuration.CATEGORY_GENERAL, "SilverfishUseAccurateModelSize", false, "This will adjust the Silverfish's size to match the hitbox's size.").getBoolean(false);

 

        SkeletonReplaceModel = config.get(Configuration.CATEGORY_GENERAL, "SkeletonReplaceModel", true, "This will change the Skeleton model into the mobtalker design.").getBoolean(true);

        SkeletonAimedBow = config.get(Configuration.CATEGORY_GENERAL, "SkeletonAimedBow", true, "When holding a bow, the skeleton will use a different animation.").getBoolean(true);

 

    SlimeReplaceModel = config.get(Configuration.CATEGORY_GENERAL, "SlimeReplaceModel", true, "This will change the Slime model into the mobtalker design.").getBoolean(true);

    SlimeUseAccurateHitbox = config.get(Configuration.CATEGORY_GENERAL, "SlimeUseAccurateHitbox", false, "This will adjust the Slime's hitbox to match model's size.").getBoolean(false);

    SlimeUseAccurateModelSize = config.get(Configuration.CATEGORY_GENERAL, "SlimeUseAccurateModelSize", false, "This will adjust the Slime's size to match the hitbox's size.").getBoolean(false);

 

    SnowGolemReplaceModel = config.get(Configuration.CATEGORY_GENERAL, "SnowGolemReplaceModel", true, "This will change the Snow Golem model into the mobtalker design.").getBoolean(true);

 

        SpiderReplaceModel = config.get(Configuration.CATEGORY_GENERAL, "SpiderReplaceModel", true, "This will change the Spider model into the mobtalker design.").getBoolean(true);

SpiderUseAccurateHitbox = config.get(Configuration.CATEGORY_GENERAL, "SpiderUseAccurateHitbox", false, "This will adjust the Spider's hitbox to match model's size.").getBoolean(false);

   

        MagmaCubeReplaceModel = config.get(Configuration.CATEGORY_GENERAL, "MagmaCubeReplaceModel", true, "This will change the Magma Cube model into the mobtalker design.").getBoolean(true);

  MagmaCubeUseAccurateHitbox = config.get(Configuration.CATEGORY_GENERAL, "MagmaCubeUseAccurateHitbox", false, "This will adjust the Magma Cube's hitbox to match model's size.").getBoolean(false);

    MagmaCubeUseAccurateModelSize = config.get(Configuration.CATEGORY_GENERAL, "MagmaCubeUseAccurateModelSize", false, "This will adjust the Magma Cube's size to match the hitbox's size.").getBoolean(false);

         

    VillagerReplaceModel = config.get(Configuration.CATEGORY_GENERAL, "VillagerReplaceModel", true, "This will change the Villager model into the mobtalker design.").getBoolean(true);

   

        WitchReplaceModel = config.get(Configuration.CATEGORY_GENERAL, "WitchReplaceModel", true, "This will change the Witch model into the mobtalker design.").getBoolean(true);

 

        WolfReplaceModel = config.get(Configuration.CATEGORY_GENERAL, "WolfReplaceModel", true, "This will change the Wolf model into the mobtalker design.").getBoolean(true);

   

        ZombieReplaceModel = config.get(Configuration.CATEGORY_GENERAL, "ZombieReplaceModel", true, "This will change the Zombie model into the mobtalker design.").getBoolean(true);

        ZombieExtendedHands = config.get(Configuration.CATEGORY_GENERAL, "ZombieExtendedHands", true, "This will make Zombie extend its arms forward.").getBoolean(true);

 

config.save();

}

 

    @EventHandler

public void load(FMLInitializationEvent event)

    {

MinecraftForge.EVENT_BUS.register(new CMMEventHandler());

proxy.registerRenderThings();

if (enableMod && GhastSSpawnGhastSister) {

EntityRegistry.registerModEntity(EntityCMMGhastS.class, "GhastS", 0, this, 40, 1, true);

EntityRegistry.addSpawn(EntityCMMGhastS.class, 50, 4, 4, EnumCreatureType.monster, BiomeGenBase.hell);

registerEntityEgg(EntityCMMGhastS.class, 0xF0f0f0, 0xc8c8c8);

}

}

 

public static int getUniqueEntityId() {

do

{ startEntityId++; }

while (EntityList.getStringFromID(startEntityId) != null);

return startEntityId;

}

 

public static void registerEntityEgg(Class<? extends Entity> entity, int primaryColor, int secondaryColor)

{

int id = getUniqueEntityId();

EntityList.IDtoClassMapping.put(id, entity);

EntityList.entityEggs.put(id, new EntityList.EntityEggInfo(id, primaryColor, secondaryColor));

}

}

 

 

 

[spoiler=CMMClientProxy/CommonProxy]public class CMMClientProxy extends CMMCommonProxy

{

    @Override

    public void registerRenderThings()

    {

RenderingRegistry.registerEntityRenderingHandler(EntityCMMBlaze.class, new RenderCMMBlaze(new ModelCMMBlaze(0, 0, 0, 0), 0.3F));

RenderingRegistry.registerEntityRenderingHandler(EntityCMMGhast.class, new RenderCMMGhast(new ModelCMMGhast(), 0.3F));

RenderingRegistry.registerEntityRenderingHandler(EntityCMMGhastS.class, new RenderCMMGhastS(new ModelCMMGhastS(), 0.3F));

    }

}


public class CMMCommonProxy

{

    public void registerRenderThings() {}

    public void registerSoundHandler() {}

}

 

 

Posted

alright, that works now. i guess the slight visible lag when the mobs are deleted and replaced with another one is unavoidable, but this is good enough.

 

thanks.


actually, there's one more problem i encountered. whenever i do this to replace a slime/magma cube, it loses its size value, so the new big slime splits into ones that often have a big slime as well (since it replaces the existing slime with a completely new entity without the size set), creating an endless stream of slimes. dropping one into lava for example will quickly lag the game as hundreds of slimes spawn out of it within seconds.

 

is there a way to make the setSlimeSize get that value from the original slime it replaces?

Posted

it mostly seems to be working now, although i got hit by a crash when trying to replace existing mobs with any of my own.

 

i had to use full path to the class for it to work though (event.entity.getClass() == net.minecraft.entity.monster.EntityCaveSpider.class), just the EntityCaveSpider.class by itself didn't seem do to anything.

 

You could also use .getClass().getSimpleName() == "EntityCaveSpider"

Posted

edit: i tried doing that, but the code stopped working and mobs were no longer getting replaced.

 

i still have the problem with mobs not inheriting their creators' variables though, which is especially bad with the slimes and magma cubes.

Posted

I think the more appropriate way of copying data from one entity to another is by calling entityTarget.copyDataFrom(entitySrc, true). This is the way minecraft teleports entities etc. and some modders will use it more often than. At worst case this method does the same thing as write and reading from NBTTag so don't worry, you won't have to deal with that.

Posted

alright, this seems to have fixed the problem. the custom replaced slimes now divide correctly and spawn the lesser slimes all the time.

 

edit: it even saves other stuff like custom name, ownership and stuff like invincibility, persistencerequired and such. this is perfect. gonna apply this to every mob.

 

thanks.

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.