Jump to content

[1.7.2] How to make a player invisible to mobs?


SackCastellon

Recommended Posts

I'm not sure if this would be the most efficient way, but:

 

1. Setup an entity tick event

2. Check if entity is a mob

3. Check if mob has a target (the player)

4. Remove if it does

 

There is LivingSetAttackTargetEvent.

 

Ok, but, could you give me some steps to do it? code examples?

Link to comment
Share on other sites

Hi

 

This has some useful code

http://www.minecraftforum.net/topic/1419836-131-forge-4x-events-howto/

 

 

Not sure how you would cancel the event, it doesn't seem to be cancelable like normal events, unless I'm missing something.

 

You could perhaps use

 

@ForgeSubscribe
public void entityTarget(LivingSetAttackTargetEvent event)
{
  
  if (event.target != null
     && event.target instanceof EntityPlayer) {
    event.entityLiving.setAttackTarget(null);
  }
}

 

Not sure if that will work since the call to setAttackTarget is reentrant, i.e. will trigger another LivingSetAttackTargetEvent.  Also, setting target to null like this might perhaps cause a crash.

 

And, probably, the mobs will just stand around doing nothing instead of ignoring the player.

 

But it's worth a try :-)

 

-TGG

Link to comment
Share on other sites

What TGG said, though if you check properly the second post to the set living attack target event should process just fine. Btw, checking instanceof automatically null checks for you:

if (event.target instanceof EntityPlayer) {
((EntityLiving) event.entity).setAttackTarget(null);
}

That will make the mobs mostly just stand around doing nothing, even if you attack them. If you want them to fight back, you should add the following check to the check for instanceof EntityPlayer:

&& event.entityLiving.func_94060_bK() != event.target)

Note also that this only works on mobs that are using the AI system - spiders, for example, will still attack you.

Link to comment
Share on other sites

Hi

 

This has some useful code

http://www.minecraftforum.net/topic/1419836-131-forge-4x-events-howto/

 

 

Not sure how you would cancel the event, it doesn't seem to be cancelable like normal events, unless I'm missing something.

 

You could perhaps use

 

@ForgeSubscribe
public void entityTarget(LivingSetAttackTargetEvent event)
{
  
  if (event.target != null
     && event.target instanceof EntityPlayer) {
    event.entityLiving.setAttackTarget(null);
  }
}

 

Not sure if that will work since the call to setAttackTarget is reentrant, i.e. will trigger another LivingSetAttackTargetEvent.  Also, setting target to null like this might perhaps cause a crash.

 

And, probably, the mobs will just stand around doing nothing instead of ignoring the player.

 

But it's worth a try :-)

 

-TGG

 

What TGG said, though if you check properly the second post to the set living attack target event should process just fine. Btw, checking instanceof automatically null checks for you:

if (event.target instanceof EntityPlayer) {
((EntityLiving) event.entity).setAttackTarget(null);
}

That will make the mobs mostly just stand around doing nothing, even if you attack them. If you want them to fight back, you should add the following check to the check for instanceof EntityPlayer:

&& event.entityLiving.func_94060_bK() != event.target)

Note also that this only works on mobs that are using the AI system - spiders, for example, will still attack you.

 

Ok, thanks, it works.

 

Now i have another problem:

 

If the player is firstly invisible, then the mobs don't attack him, but if the mobs are attacking him and the player becomes invisible, the mobs still attack him.

 

This is my code:

/**
 * Only works with AI mobs: Zombies, Skeletons and Creepers.
 * @param event
 */
@SubscribeEvent
public void onEntitySetTarget(LivingSetAttackTargetEvent event)
{
	if (Loader.isModLoaded("SKC-Camouflage"))
	{
		if (event.target != null && event.target instanceof EntityPlayer && event.entityLiving.func_94060_bK() != event.target)
    	{
			if (event.target.isInvisible())
			{
				((EntityLiving) event.entity).setAttackTarget(null);
			}
    	}
	}
    }

Link to comment
Share on other sites

Hi

 

This has some useful code

http://www.minecraftforum.net/topic/1419836-131-forge-4x-events-howto/

 

 

Not sure how you would cancel the event, it doesn't seem to be cancelable like normal events, unless I'm missing something.

 

You could perhaps use

 

@ForgeSubscribe
public void entityTarget(LivingSetAttackTargetEvent event)
{
  
  if (event.target != null
     && event.target instanceof EntityPlayer) {
    event.entityLiving.setAttackTarget(null);
  }
}

 

Not sure if that will work since the call to setAttackTarget is reentrant, i.e. will trigger another LivingSetAttackTargetEvent.  Also, setting target to null like this might perhaps cause a crash.

 

And, probably, the mobs will just stand around doing nothing instead of ignoring the player.

 

But it's worth a try :-)

 

-TGG

 

What TGG said, though if you check properly the second post to the set living attack target event should process just fine. Btw, checking instanceof automatically null checks for you:

if (event.target instanceof EntityPlayer) {
((EntityLiving) event.entity).setAttackTarget(null);
}

That will make the mobs mostly just stand around doing nothing, even if you attack them. If you want them to fight back, you should add the following check to the check for instanceof EntityPlayer:

&& event.entityLiving.func_94060_bK() != event.target)

Note also that this only works on mobs that are using the AI system - spiders, for example, will still attack you.

 

Ok, thanks, it works.

 

Now i have another problem:

 

If the player is firstly invisible, then the mobs don't attack him, but if the mobs are attacking him and the player becomes invisible, the mobs still attack him.

 

This is my code:

/**
 * Only works with AI mobs: Zombies, Skeletons and Creepers.
 * @param event
 */
@SubscribeEvent
public void onEntitySetTarget(LivingSetAttackTargetEvent event)
{
	if (Loader.isModLoaded("SKC-Camouflage"))
	{
		if (event.target != null && event.target instanceof EntityPlayer && event.entityLiving.func_94060_bK() != event.target)
    	{
			if (event.target.isInvisible())
			{
				((EntityLiving) event.entity).setAttackTarget(null);
			}
    	}
	}
    }

That's because the mob already has a target, so it won't set a new. So you'll have to deal with it, or find a solution for it.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Link to comment
Share on other sites

You could subscribe to LivingAttackEvent as well, checking if the player is invisible and getting the source of the source of damage (yes, you read that right), checking if that is an EntityLiving and then setting their current target to null. Obviously that won't work for everything - creepers, for instance - but it should cover most. Otherwise, you could get all of the living entities nearby the player when they turn invisible and set their targets to null at that time, if their current target is the player turning invisible. Probably simpler to just deal with some mobs still attacking.

Link to comment
Share on other sites

You could subscribe to LivingAttackEvent as well, checking if the player is invisible and getting the source of the source of damage (yes, you read that right), checking if that is an EntityLiving and then setting their current target to null. Obviously that won't work for everything - creepers, for instance - but it should cover most. Otherwise, you could get all of the living entities nearby the player when they turn invisible and set their targets to null at that time, if their current target is the player turning invisible. Probably simpler to just deal with some mobs still attacking.

 

Ok, but where's the ".setCurrentTarget()" (or similar) method is located?

 

Link to comment
Share on other sites

Ok, but where's the ".setCurrentTarget()" (or similar) method is located?

You can't be serious... haven't you been paying attention to the thread at all? EntityLiving#setAttackTarget has been featured in probably every single bit of code that has been used in the examples.

 

:'( Sorry for that stupid question, but i've just got up.

 

Ok, did it and the mobs (only tested zombies) don't attack me. But if i touch them then minecraft crashes.

 

[12:56:51] [server thread/ERROR]: Encountered an unexpected exception
net.minecraft.util.ReportedException: Ticking entity
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:745) ~[MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:650) ~[MinecraftServer.class:?]
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:120) ~[integratedServer.class:?]
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:528) [MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:787) [MinecraftServer$2.class:?]
Caused by: java.lang.ClassCastException: net.minecraft.entity.player.EntityPlayerMP cannot be cast to net.minecraft.entity.EntityLiving
at com.sackcastellon.core.event.MinecraftForgeEvents.onEntityAttack(MinecraftForgeEvents.java:50) ~[MinecraftForgeEvents.class:?]
at cpw.mods.fml.common.eventhandler.ASMEventHandler_6_MinecraftForgeEvents_onEntityAttack_LivingAttackEvent.invoke(.dynamic) ~[?:?]
at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:51) ~[ASMEventHandler.class:?]
at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:122) ~[EventBus.class:?]
at net.minecraftforge.common.ForgeHooks.onLivingAttack(ForgeHooks.java:274) ~[ForgeHooks.class:?]
at net.minecraft.entity.player.EntityPlayer.attackEntityFrom(EntityPlayer.java:1132) ~[EntityPlayer.class:?]
at net.minecraft.entity.player.EntityPlayerMP.attackEntityFrom(EntityPlayerMP.java:564) ~[EntityPlayerMP.class:?]
at net.minecraft.entity.monster.EntityMob.attackEntityAsMob(EntityMob.java:140) ~[EntityMob.class:?]
at net.minecraft.entity.monster.EntityZombie.attackEntityAsMob(EntityZombie.java:333) ~[EntityZombie.class:?]
at net.minecraft.entity.ai.EntityAIAttackOnCollide.updateTask(EntityAIAttackOnCollide.java:175) ~[EntityAIAttackOnCollide.class:?]
at net.minecraft.entity.ai.EntityAITasks.onUpdateTasks(EntityAITasks.java:131) ~[EntityAITasks.class:?]
at net.minecraft.entity.EntityLiving.updateAITasks(EntityLiving.java:633) ~[EntityLiving.class:?]
at net.minecraft.entity.EntityLivingBase.onLivingUpdate(EntityLivingBase.java:2023) ~[EntityLivingBase.class:?]
at net.minecraft.entity.EntityLiving.onLivingUpdate(EntityLiving.java:451) ~[EntityLiving.class:?]
at net.minecraft.entity.monster.EntityMob.onLivingUpdate(EntityMob.java:39) ~[EntityMob.class:?]
at net.minecraft.entity.monster.EntityZombie.onLivingUpdate(EntityZombie.java:236) ~[EntityZombie.class:?]
at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:1856) ~[EntityLivingBase.class:?]
at net.minecraft.entity.EntityLiving.onUpdate(EntityLiving.java:270) ~[EntityLiving.class:?]
at net.minecraft.entity.monster.EntityMob.onUpdate(EntityMob.java:47) ~[EntityMob.class:?]
at net.minecraft.entity.monster.EntityZombie.onUpdate(EntityZombie.java:328) ~[EntityZombie.class:?]
at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2286) ~[World.class:?]
at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:705) ~[WorldServer.class:?]
at net.minecraft.world.World.updateEntity(World.java:2246) ~[World.class:?]
at net.minecraft.world.World.updateEntities(World.java:2096) ~[World.class:?]
at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:536) ~[WorldServer.class:?]
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:739) ~[MinecraftServer.class:?]
... 4 more
[12:56:51] [server thread/ERROR]: This crash report has been saved to: C:\Users\Juanjo hijo\AppData\Roaming\Modding\forge-1.7.2-10.12.0.1024-src\.\crash-reports\crash-2014-03-24_12.56.51-server.txt
[12:56:51] [server thread/INFO]: Stopping server
[12:56:51] [server thread/INFO]: Saving players
---- Minecraft Crash Report ----
// Quite honestly, I wouldn't worry myself about that.

Time: 24/03/14 12:56
Description: Ticking entity

java.lang.ClassCastException: net.minecraft.entity.player.EntityPlayerMP cannot be cast to net.minecraft.entity.EntityLiving
at com.sackcastellon.core.event.MinecraftForgeEvents.onEntityAttack(MinecraftForgeEvents.java:50)
at cpw.mods.fml.common.eventhandler.ASMEventHandler_6_MinecraftForgeEvents_onEntityAttack_LivingAttackEvent.invoke(.dynamic)
at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:51)
at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:122)
at net.minecraftforge.common.ForgeHooks.onLivingAttack(ForgeHooks.java:274)
at net.minecraft.entity.player.EntityPlayer.attackEntityFrom(EntityPlayer.java:1132)
at net.minecraft.entity.player.EntityPlayerMP.attackEntityFrom(EntityPlayerMP.java:564)
at net.minecraft.entity.monster.EntityMob.attackEntityAsMob(EntityMob.java:140)
at net.minecraft.entity.monster.EntityZombie.attackEntityAsMob(EntityZombie.java:333)
at net.minecraft.entity.ai.EntityAIAttackOnCollide.updateTask(EntityAIAttackOnCollide.java:175)
at net.minecraft.entity.ai.EntityAITasks.onUpdateTasks(EntityAITasks.java:131)
at net.minecraft.entity.EntityLiving.updateAITasks(EntityLiving.java:633)
at net.minecraft.entity.EntityLivingBase.onLivingUpdate(EntityLivingBase.java:2023)
at net.minecraft.entity.EntityLiving.onLivingUpdate(EntityLiving.java:451)
at net.minecraft.entity.monster.EntityMob.onLivingUpdate(EntityMob.java:39)
at net.minecraft.entity.monster.EntityZombie.onLivingUpdate(EntityZombie.java:236)
at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:1856)
at net.minecraft.entity.EntityLiving.onUpdate(EntityLiving.java:270)
at net.minecraft.entity.monster.EntityMob.onUpdate(EntityMob.java:47)
at net.minecraft.entity.monster.EntityZombie.onUpdate(EntityZombie.java:328)
at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2286)
at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:705)
at net.minecraft.world.World.updateEntity(World.java:2246)
at net.minecraft.world.World.updateEntities(World.java:2096)
at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:536)
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:739)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:650)
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:120)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:528)
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:787)


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

-- Head --
Stacktrace:
at com.sackcastellon.core.event.MinecraftForgeEvents.onEntityAttack(MinecraftForgeEvents.java:50)
at cpw.mods.fml.common.eventhandler.ASMEventHandler_6_MinecraftForgeEvents_onEntityAttack_LivingAttackEvent.invoke(.dynamic)
at cpw.mods.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:51)
at cpw.mods.fml.common.eventhandler.EventBus.post(EventBus.java:122)
at net.minecraftforge.common.ForgeHooks.onLivingAttack(ForgeHooks.java:274)
at net.minecraft.entity.player.EntityPlayer.attackEntityFrom(EntityPlayer.java:1132)
at net.minecraft.entity.player.EntityPlayerMP.attackEntityFrom(EntityPlayerMP.java:564)
at net.minecraft.entity.monster.EntityMob.attackEntityAsMob(EntityMob.java:140)
at net.minecraft.entity.monster.EntityZombie.attackEntityAsMob(EntityZombie.java:333)
at net.minecraft.entity.ai.EntityAIAttackOnCollide.updateTask(EntityAIAttackOnCollide.java:175)
at net.minecraft.entity.ai.EntityAITasks.onUpdateTasks(EntityAITasks.java:131)
at net.minecraft.entity.EntityLiving.updateAITasks(EntityLiving.java:633)
at net.minecraft.entity.EntityLivingBase.onLivingUpdate(EntityLivingBase.java:2023)
at net.minecraft.entity.EntityLiving.onLivingUpdate(EntityLiving.java:451)
at net.minecraft.entity.monster.EntityMob.onLivingUpdate(EntityMob.java:39)
at net.minecraft.entity.monster.EntityZombie.onLivingUpdate(EntityZombie.java:236)
at net.minecraft.entity.EntityLivingBase.onUpdate(EntityLivingBase.java:1856)
at net.minecraft.entity.EntityLiving.onUpdate(EntityLiving.java:270)
at net.minecraft.entity.monster.EntityMob.onUpdate(EntityMob.java:47)
at net.minecraft.entity.monster.EntityZombie.onUpdate(EntityZombie.java:328)
at net.minecraft.world.World.updateEntityWithOptionalForce(World.java:2286)
at net.minecraft.world.WorldServer.updateEntityWithOptionalForce(WorldServer.java:705)
at net.minecraft.world.World.updateEntity(World.java:2246)

-- Entity being ticked --
Details:
Entity Type: Zombie (net.minecraft.entity.monster.EntityZombie)
Entity ID: 4
Entity Name: Zombie
Entity's Exact location: -1321,83, 56,00, 925,34
Entity's Block location: World: (-1322,56,925), Chunk: (at 6,3,13 in -83,57; contains blocks -1328,0,912 to -1313,255,927), Region: (-3,1; contains chunks -96,32 to -65,63, blocks -1536,0,512 to -1025,255,1023)
Entity's Momentum: 0,00, -0,08, 0,00
Stacktrace:
at net.minecraft.world.World.updateEntities(World.java:2096)
at net.minecraft.world.WorldServer.updateEntities(WorldServer.java:536)

-- Affected level --
Details:
Level name: New World
All players: 1 total; [EntityPlayerMP['Player4'/6, l='New World', x=-1320,69, y=56,00, z=925,46]]
Chunk stats: ServerChunkCache: 646 Drop: 0
Level seed: 4740230574978669681
Level generator: ID 01 - flat, ver 0. Features enabled: false
Level generator options: 2;7,3x1,52x24;2;
Level spawn location: World: (-1359,4,966), Chunk: (at 1,0,6 in -85,60; contains blocks -1360,0,960 to -1345,255,975), Region: (-3,1; contains chunks -96,32 to -65,63, blocks -1536,0,512 to -1025,255,1023)
Level time: 141224 game time, 13000 day time
Level dimension: 0
Level storage version: 0x04ABD - Anvil
Level weather: Rain time: 80681 (now: false), thunder time: 91378 (now: false)
Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: true
Stacktrace:
at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:739)
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:650)
at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:120)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:528)
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:787)

-- System Details --
Details:
Minecraft Version: 1.7.2
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.7.0_25, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 169809664 bytes (161 MB) / 448659456 bytes (427 MB) up to 878051328 bytes (837 MB)
JVM Flags: 0 total; 
AABB Pool Size: 188 (10528 bytes; 0 MB) allocated, 55 (3080 bytes; 0 MB) used
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP v9.01-pre FML v7.2.116.1024 Minecraft Forge 10.12.0.1024 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.1024} [Forge Mod Loader] (forgeSrc-1.7.2-10.12.0.1024.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
Forge{10.12.0.1024} [Minecraft Forge] (forgeSrc-1.7.2-10.12.0.1024.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
SKC-Core{1.1.1.0} [sKC Core] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
SKC-BetterWood{1.1.0.0} [better Wood] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
SKC-Camouflage{1.1.0.0} [Camouflage] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
SKC-CraftableHorseArmor{1.1.1.0} [Craftable Horse Armor] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available
Profiler Position: N/A (disabled)
Vec3 Pool Size: 149 (8344 bytes; 0 MB) allocated, 92 (5152 bytes; 0 MB) used
Player Count: 1 / 8; [EntityPlayerMP['Player4'/6, l='New World', x=-1320,69, y=56,00, z=925,46]]
Type: Integrated Server (map_client.txt)
Is Modded: Definitely; Client brand changed to 'fml,forge'
#@!@# Game crashed! Crash report saved to: #@!@# .\crash-reports\crash-2014-03-24_12.56.51-server.txt
[12:56:51] [Client Shutdown Thread/INFO]: Stopping server
[12:56:51] [Client Shutdown Thread/INFO]: Saving players
AL lib: (EE) alc_cleanup: 1 device not closed

Link to comment
Share on other sites

You don't know how to prevent class cast exceptions? It crashed because whatever code you ran is indiscriminately casting every single entity it comes across as an EntityLiving, when the entity may very well not be one, such as the EntityPlayerMP in your crash log.

 

Solution: instanceof

 

EntityLiving and EntityPlayer are both subclasses of EntityLivingBase, but you cannot cast one to the other unless it is an X instanceof Y (you can cast both to EntityLivingBase, if that's what you need, though.) SO, put an 'if' in there to catch that and use logic.

 

Link to comment
Share on other sites

EntityLiving and EntityPlayer are both subclasses of EntityLivingBase, but you cannot cast one to the other unless it is an X instanceof Y (you can cast both to EntityLivingBase, if that's what you need, though.) SO, put an 'if' in there to catch that and use logic.

That has nothing to do with the topic, he is trying to use a method in EntityLiving, not EntityLivingBase, so he needs to check if the entity in question is an instanceof EntityLiving before casting. Stop confusing people with random comments.

Link to comment
Share on other sites

EntityLiving and EntityPlayer are both subclasses of EntityLivingBase, but you cannot cast one to the other unless it is an X instanceof Y (you can cast both to EntityLivingBase, if that's what you need, though.) SO, put an 'if' in there to catch that and use logic.

That has nothing to do with the topic, he is trying to use a method in EntityLiving, not EntityLivingBase, so he needs to check if the entity in question is an instanceof EntityLiving before casting. Stop confusing people with random comments.

 

I don't find your attitude helpful. Perhaps you could keep your snide comments out of the fora.

Link to comment
Share on other sites

EntityLiving and EntityPlayer are both subclasses of EntityLivingBase, but you cannot cast one to the other unless it is an X instanceof Y (you can cast both to EntityLivingBase, if that's what you need, though.) SO, put an 'if' in there to catch that and use logic.

That has nothing to do with the topic, he is trying to use a method in EntityLiving, not EntityLivingBase, so he needs to check if the entity in question is an instanceof EntityLiving before casting. Stop confusing people with random comments.

I don't find your attitude helpful. Perhaps you could keep your snide comments out of the fora.

How is clarifying a statement that confuses the issue at hand being snide or unhelpful? I've seen you give people some excellent advice on challenging questions in other threads, but there have been several cases where you've been either plain wrong or providing extraneous information that diverts from the main point; in the latter cases, I feel it is indeed helpful to point it out and provide either clarification or correction as needed. When I say "stop confusing people with random statements", I'm referring to the latter; for the former, it is helpful to fact-check before posting replies to make sure the information you provide is accurate. If you consider that snide, well, that's your call.

Link to comment
Share on other sites

EntityLiving and EntityPlayer are both subclasses of EntityLivingBase, but you cannot cast one to the other unless it is an X instanceof Y (you can cast both to EntityLivingBase, if that's what you need, though.) SO, put an 'if' in there to catch that and use logic.

That has nothing to do with the topic, he is trying to use a method in EntityLiving, not EntityLivingBase, so he needs to check if the entity in question is an instanceof EntityLiving before casting. Stop confusing people with random comments.

I don't find your attitude helpful. Perhaps you could keep your snide comments out of the fora.

How is clarifying a statement that confuses the issue at hand being snide or unhelpful? I've seen you give people some excellent advice on challenging questions in other threads, but there have been several cases where you've been either plain wrong or providing extraneous information that diverts from the main point; in the latter cases, I feel it is indeed helpful to point it out and provide either clarification or correction as needed. When I say "stop confusing people with random statements", I'm referring to the latter; for the former, it is helpful to fact-check before posting replies to make sure the information you provide is accurate. If you consider that snide, well, that's your call.

Your remarks were and continue to be out of band for these fora. Your tutorials are nice, but all you do is self-advertise your ability to learn from tutorials. So, when all you have to add is "hey, look at my totorial," you really don't have any place suggesting I change my posting habits to suit you.

Now, please grow the hell up and stop this quibbling. It gains nothing and bores me.

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.



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I have run the server on a second device and my friend had the same issues as before where he was in the server and could move client side but nothing happened server side but any blocks he broke near his actual player did break but that was it, after a while he saw things move but it was around 2 minutes delay but this time he didn't get timed out This leads me to still believe it is an internet issue but i have no clue what it could be as the logs say nothing about this and both of us have decent internet so maybe the router is limiting the amount of data that can be sent leading to the delay and eventual timeout.  
    • Hi, I'm a newbie in Minecraft Mods and I've been following some guides to create my Mod. But I've had a problem that I have not been able to solve in any way. When I try to equip an item to my custom Entity like for example, a diamond sword, The item never renders in your hand. How can I solve this? I leave the code of my entity below   BrotecitoModel class package com.example.examplemod.entity.client; import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.VertexConsumer; import net.minecraft.client.model.ArmedModel; import net.minecraft.client.model.HierarchicalModel; import net.minecraft.client.model.geom.ModelPart; import net.minecraft.client.model.geom.PartPose; import net.minecraft.client.model.geom.builders.*; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.HumanoidArm; public class BrotecitoModel<T extends Entity> extends HierarchicalModel<T> implements ArmedModel { private final ModelPart brotecito; private final ModelPart arms; private final ModelPart pot; private final ModelPart rightArm; private final ModelPart leaf; private final ModelPart head; private final ModelPart leftArm; private final ModelPart frontPot; private final ModelPart backPot; private final ModelPart leftPot; private final ModelPart rightPot; private final ModelPart upperLeftPot; private final ModelPart upperRightPot; private final ModelPart upperFrontPot; private final ModelPart upperBackPot; private final ModelPart bottomPotFaceAndSoil; public BrotecitoModel(ModelPart root) { this.brotecito = root.getChild("brotecito"); this.leaf = brotecito.getChild("leaf"); this.head = brotecito.getChild("head"); this.arms = brotecito.getChild("arms"); this.pot = brotecito.getChild("pot"); this.leftArm = arms.getChild("leftArm"); this.rightArm = arms.getChild("rightArm"); this.frontPot = pot.getChild("frontPot"); this.backPot = pot.getChild("backPot"); this.leftPot = pot.getChild("leftPot"); this.rightPot = pot.getChild("rightPot"); this.upperLeftPot = pot.getChild("upperLeftPot"); this.upperRightPot = pot.getChild("upperRightPot"); this.upperFrontPot = pot.getChild("upperFrontPot"); this.upperBackPot = pot.getChild("upperBackPot"); this.bottomPotFaceAndSoil = pot.getChild("bottomPotFaceAndSoil"); } public static LayerDefinition createBodyLayer() { MeshDefinition meshdefinition = new MeshDefinition(); PartDefinition partdefinition = meshdefinition.getRoot(); PartDefinition brotecito = partdefinition.addOrReplaceChild("brotecito", CubeListBuilder.create(), PartPose.offset(0.0F, 24.0F, 0.0F)); PartDefinition leaf = brotecito.addOrReplaceChild("leaf", CubeListBuilder.create().texOffs(1, 4).addBox(1.3045F, 1.7638F, 2.1262F, 1.0F, 1.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(1.3045F, -13.7638F, 4.1262F, -3.1416F, 0.0F, 3.1416F)); PartDefinition leafLower_r1 = leaf.addOrReplaceChild("leafLower_r1", CubeListBuilder.create().texOffs(53, 44).addBox(-2.3827F, -0.2609F, 1.5675F, 3.0F, 1.0F, 1.0F, new CubeDeformation(0.0F)) .texOffs(53, 41).addBox(-2.3827F, -7.2609F, 1.5675F, 3.0F, 1.0F, 1.0F, new CubeDeformation(0.0F)) .texOffs(51, 18).addBox(-3.3827F, -6.2609F, 1.5675F, 5.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.3394F, 2.5155F, -1.0048F, 0.7854F, 0.3927F, 0.0F)); PartDefinition leaftRoot2_r1 = leaf.addOrReplaceChild("leaftRoot2_r1", CubeListBuilder.create().texOffs(1, 1).addBox(-0.8827F, -1.9942F, 1.1189F, 1.0F, 1.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.5926F, 3.4932F, 0.7139F, 0.3927F, 0.3927F, 0.0F)); PartDefinition head = brotecito.addOrReplaceChild("head", CubeListBuilder.create().texOffs(41, 1).addBox(-4.9286F, -2.3571F, 4.5F, 10.0F, 6.0F, 1.0F, new CubeDeformation(0.0F)) .texOffs(26, 28).addBox(-4.9286F, -3.3571F, -4.5F, 10.0F, 1.0F, 9.0F, new CubeDeformation(0.0F)) .texOffs(27, 19).addBox(-3.9286F, -4.3571F, -3.5F, 8.0F, 1.0F, 7.0F, new CubeDeformation(0.0F)) .texOffs(1, 8).addBox(-3.9286F, 3.6429F, -4.5F, 8.0F, 1.0F, 9.0F, new CubeDeformation(0.0F)) .texOffs(1, 35).addBox(-5.9286F, -2.3571F, -4.5F, 2.0F, 6.0F, 9.0F, new CubeDeformation(0.0F)) .texOffs(10, 19).addBox(3.0714F, -2.3571F, -4.5F, 3.0F, 6.0F, 9.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0714F, -6.6429F, -0.5F, -3.1416F, 0.0F, 3.1416F)); PartDefinition backFace_r1 = head.addOrReplaceChild("backFace_r1", CubeListBuilder.create().texOffs(28, 0).addBox(4.0F, -8.0F, -5.0F, 1.0F, 6.0F, 10.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0714F, 5.6429F, -0.5F, 0.0F, 1.5708F, 0.0F)); PartDefinition arms = brotecito.addOrReplaceChild("arms", CubeListBuilder.create(), PartPose.offset(0.0F, 0.0F, 0.0F)); PartDefinition rightArm = arms.addOrReplaceChild("rightArm", CubeListBuilder.create().texOffs(21, 1).addBox(-1.0F, -1.0F, 2.0F, 2.0F, 2.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offset(-7.0F, -5.0767F, -6.9556F)); PartDefinition leftArm = arms.addOrReplaceChild("leftArm", CubeListBuilder.create().texOffs(7, 1).addBox(-1.0F, -1.0F, 2.0F, 2.0F, 2.0F, 4.0F, new CubeDeformation(0.0F)), PartPose.offset(7.0F, -5.0767F, -6.9556F)); PartDefinition pot = brotecito.addOrReplaceChild("pot", CubeListBuilder.create(), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, -3.1416F, 0.0F, 3.1416F)); PartDefinition frontPot = pot.addOrReplaceChild("frontPot", CubeListBuilder.create().texOffs(33, 62).addBox(-7.0F, -2.0F, 6.0F, 14.0F, 1.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 0.0F, 0.0F)); PartDefinition backPot = pot.addOrReplaceChild("backPot", CubeListBuilder.create(), PartPose.offset(0.0F, 0.0F, 0.0F)); PartDefinition backPot_r1 = backPot.addOrReplaceChild("backPot_r1", CubeListBuilder.create().texOffs(33, 59).addBox(-7.0F, -2.0F, 6.0F, 14.0F, 1.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, 3.1416F, 0.0F)); PartDefinition leftPot = pot.addOrReplaceChild("leftPot", CubeListBuilder.create(), PartPose.offset(0.0F, 0.0F, 0.0F)); PartDefinition leftPot_r1 = leftPot.addOrReplaceChild("leftPot_r1", CubeListBuilder.create().texOffs(1, 53).addBox(-6.0F, -2.0F, 6.0F, 12.0F, 1.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -1.5708F, 0.0F)); PartDefinition rightPot = pot.addOrReplaceChild("rightPot", CubeListBuilder.create(), PartPose.offset(0.0F, 0.0F, 0.0F)); PartDefinition rightPot_r1 = rightPot.addOrReplaceChild("rightPot_r1", CubeListBuilder.create().texOffs(1, 56).addBox(-6.0F, -2.0F, 6.0F, 12.0F, 1.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, 1.5708F, 0.0F)); PartDefinition upperLeftPot = pot.addOrReplaceChild("upperLeftPot", CubeListBuilder.create(), PartPose.offset(0.0F, 0.0F, 0.0F)); PartDefinition upperLeftPot_r1 = upperLeftPot.addOrReplaceChild("upperLeftPot_r1", CubeListBuilder.create().texOffs(0, 59).addBox(-8.0F, -3.0F, 7.0F, 15.0F, 1.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -1.5708F, 0.0F)); PartDefinition upperRightPot = pot.addOrReplaceChild("upperRightPot", CubeListBuilder.create(), PartPose.offset(0.0F, 0.0F, 0.0F)); PartDefinition upperRightPot_r1 = upperRightPot.addOrReplaceChild("upperRightPot_r1", CubeListBuilder.create().texOffs(29, 53).addBox(-8.0F, -3.0F, -8.0F, 16.0F, 1.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offsetAndRotation(0.0F, 0.0F, 0.0F, 0.0F, -1.5708F, 0.0F)); PartDefinition upperFrontPot = pot.addOrReplaceChild("upperFrontPot", CubeListBuilder.create().texOffs(0, 62).addBox(-8.0F, -3.0F, 7.0F, 15.0F, 1.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 0.0F, 0.0F)); PartDefinition upperBackPot = pot.addOrReplaceChild("upperBackPot", CubeListBuilder.create().texOffs(33, 56).addBox(-7.0F, -3.0F, -8.0F, 14.0F, 1.0F, 1.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 0.0F, 0.0F)); PartDefinition bottomPotFaceAndSoil = pot.addOrReplaceChild("bottomPotFaceAndSoil", CubeListBuilder.create().texOffs(15, 39).addBox(-6.0F, -1.0F, -6.0F, 12.0F, 1.0F, 12.0F, new CubeDeformation(0.0F)), PartPose.offset(0.0F, 0.0F, 0.0F)); return LayerDefinition.create(meshdefinition, 64, 64); } @Override public void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha) { brotecito.render(poseStack, vertexConsumer, packedLight, packedOverlay, red, green, blue, alpha); } @Override public ModelPart root() { return brotecito; } public ModelPart getArmRight() { return brotecito.getChild("arms").getChild("rightArm"); } @Override public void translateToHand(HumanoidArm p_102108_, PoseStack p_102109_) { this.getArmRight().translateAndRotate(p_102109_); } @Override public void setupAnim(T p_102618_, float p_102619_, float p_102620_, float p_102621_, float p_102622_, float p_102623_) { } } BrotecitoRenderer class package com.example.examplemod.entity.client; import com.example.examplemod.ExampleMod; import com.example.examplemod.entity.custom.brotecito.BrotecitoEntity; import com.mojang.blaze3d.vertex.PoseStack; import net.minecraft.client.renderer.MultiBufferSource; import net.minecraft.client.renderer.entity.EntityRendererProvider; import net.minecraft.client.renderer.entity.MobRenderer; import net.minecraft.client.renderer.entity.layers.ItemInHandLayer; import net.minecraft.resources.ResourceLocation; import org.jetbrains.annotations.NotNull; public class BrotecitoRenderer extends MobRenderer<BrotecitoEntity, BrotecitoModel<BrotecitoEntity>> { public static final ResourceLocation TEXTURE = new ResourceLocation(ExampleMod.MODID, "textures/entity/brotecito.png"); public BrotecitoRenderer(EntityRendererProvider.Context pContext) { super(pContext, new BrotecitoModel<>(pContext.bakeLayer(ModModelLayers.BROTECITO_LAYER)), 0.6f); this.addLayer(new ItemInHandLayer<>(this, pContext.getItemInHandRenderer())); } @Override public @NotNull ResourceLocation getTextureLocation(@NotNull BrotecitoEntity pEntity) { return TEXTURE; } @Override public void render(BrotecitoEntity pEntity, float pEntityYaw, float pPartialTicks, @NotNull PoseStack pMatrixStack, @NotNull MultiBufferSource pBuffer, int pPackedLight) { if (pEntity.isBaby()) { pMatrixStack.scale(0.3f, 0.3f, 0.3f); } super.render(pEntity, pEntityYaw, pPartialTicks, pMatrixStack, pBuffer, pPackedLight); } } BrotecitoEntity class package com.example.examplemod.entity.custom.brotecito; import com.example.examplemod.entity.ModEntities; import com.example.examplemod.particle.ModParticles; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.syncher.EntityDataAccessor; import net.minecraft.network.syncher.EntityDataSerializers; import net.minecraft.network.syncher.SynchedEntityData; import net.minecraft.server.level.ServerLevel; import net.minecraft.sounds.SoundEvent; import net.minecraft.sounds.SoundEvents; import net.minecraft.util.valueproviders.UniformInt; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.entity.*; import net.minecraft.world.entity.ai.attributes.AttributeSupplier; import net.minecraft.world.entity.ai.attributes.Attributes; import net.minecraft.world.entity.ai.goal.*; import net.minecraft.world.entity.ai.goal.target.*; import net.minecraft.world.entity.animal.Animal; import net.minecraft.world.entity.animal.Turtle; import net.minecraft.world.entity.animal.horse.AbstractHorse; import net.minecraft.world.entity.item.ItemEntity; import net.minecraft.world.entity.monster.AbstractSkeleton; import net.minecraft.world.entity.monster.Ghast; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.level.Level; import net.minecraft.world.phys.Vec3; import net.minecraft.world.scores.Team; import net.minecraftforge.event.ForgeEventFactory; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.List; import java.util.UUID; public class BrotecitoEntity extends TamableAnimal implements NeutralMob { @Nullable private UUID persistentAngerTarget; private static final UniformInt PERSISTENT_ANGER_TIME = UniformInt.of(20, 39); private static final EntityDataAccessor<Integer> DATA_REMAINING_ANGER_TIME = SynchedEntityData.defineId(BrotecitoEntity.class, EntityDataSerializers.INT); private static final EntityDataAccessor<Boolean> SITTING = SynchedEntityData.defineId(BrotecitoEntity.class, EntityDataSerializers.BOOLEAN); public BrotecitoEntity(EntityType<? extends TamableAnimal> pEntityType, Level pLevel) { super(pEntityType, pLevel); this.moveControl = new BrotecitoMoveControl(this); } // Método para que el Brotecito pueda obtener espadas de diamante y equiparlas @Override public void tick() { super.tick(); if (!this.isAlive()) { return; } List<ItemEntity> itemsNearby = this.level().getEntitiesOfClass(ItemEntity.class, this.getBoundingBox().inflate(1.0)); for (ItemEntity itemEntity : itemsNearby) { Item item = itemEntity.getItem().getItem(); if (item == Items.DIAMOND_SWORD || item == Items.BOW) { // Recoger el Objeto this.take(itemEntity, itemEntity.getItem().getCount()); // Equipar la espada this.setItemSlot(EquipmentSlot.MAINHAND, itemEntity.getItem()); itemEntity.discard(); break; } } } /** * Define el comportamiento de la IA del Brotecito */ @Override protected void registerGoals() { this.goalSelector.addGoal(1, new BrotecitoFloatGoal(this)); this.goalSelector.addGoal(2, new SitWhenOrderedToGoal(this)); this.goalSelector.addGoal(4, new LeapAtTargetGoal(this, 0.4F)); this.goalSelector.addGoal(5, new BrotecitoAttackGoal(this)); this.goalSelector.addGoal(6, new FollowOwnerGoal(this, 1.0, 10.0F, 2.0F, false)); this.goalSelector.addGoal(7, new BreedGoal(this, 1.0)); this.goalSelector.addGoal(8, new BrotecitoRandomDirectionGoal(this)); this.goalSelector.addGoal(9, new BrotecitoKeepOnJumpingGoal(this)); this.goalSelector.addGoal(10, new LookAtPlayerGoal(this, Player.class, 8.0F)); this.goalSelector.addGoal(10, new RandomLookAroundGoal(this)); this.targetSelector.addGoal(1, new OwnerHurtByTargetGoal(this)); this.targetSelector.addGoal(2, new OwnerHurtTargetGoal(this)); this.targetSelector.addGoal(3, (new HurtByTargetGoal(this)).setAlertOthers()); this.targetSelector.addGoal(6, new NonTameRandomTargetGoal<>(this, Turtle.class, false, Turtle.BABY_ON_LAND_SELECTOR)); this.targetSelector.addGoal(7, new NearestAttackableTargetGoal<>(this, AbstractSkeleton.class, false)); this.targetSelector.addGoal(8, new ResetUniversalAngerTargetGoal<>(this, true)); } public static AttributeSupplier.Builder createAttributes() { return Animal.createLivingAttributes() .add(Attributes.MAX_HEALTH, 20D) .add(Attributes.FOLLOW_RANGE, 24D) .add(Attributes.MOVEMENT_SPEED, 0.25D) .add(Attributes.ARMOR_TOUGHNESS, 0.1f) .add(Attributes.ATTACK_KNOCKBACK, 2f) .add(Attributes.ATTACK_DAMAGE, 2f); } @Nullable @Override public AgeableMob getBreedOffspring(@NotNull ServerLevel pLevel, @NotNull AgeableMob pOtherParent) { return ModEntities.BROTECITO.get().create(pLevel); } // Método para que los Brotecitos puedan emitir partículas personalizadas al aparearse @Override public void handleEntityEvent(byte id) { if (id == 18) { for(int i = 0; i < 7; i++) { double d0 = this.random.nextGaussian() * 0.02; double d1 = this.random.nextGaussian() * 0.02; double d2 = this.random.nextGaussian() * 0.02; this.level().addParticle(ModParticles.KAPPA_PRIDE_PARTICLES.get(), this.getRandomX(1.0),this.getRandomY() + 0.5, this.getRandomZ(1.0), d0, d1, d2); } } else { super.handleEntityEvent(id); } } @Override public boolean isFood(ItemStack pStack) { return pStack.is(Items.CARROT); } @Override public int getRemainingPersistentAngerTime() { return this.entityData.get(DATA_REMAINING_ANGER_TIME); } @Override public void setRemainingPersistentAngerTime(int i) { this.entityData.set(DATA_REMAINING_ANGER_TIME, i); } @Nullable @Override public UUID getPersistentAngerTarget() { return this.persistentAngerTarget; } @Override public void setPersistentAngerTarget(@Nullable UUID pTarget) { this.persistentAngerTarget = pTarget; } @Override public void startPersistentAngerTimer() { this.setRemainingPersistentAngerTime(PERSISTENT_ANGER_TIME.sample(this.random)); } /* TAMEABLE */ @Override public InteractionResult mobInteract(Player player, InteractionHand hand) { ItemStack itemStack = player.getItemInHand(hand); Item item = itemStack.getItem(); Item itemForTaming = Items.APPLE; if (isFood(itemStack)) { return super.mobInteract(player, hand); } if (item == itemForTaming && !isTame()) { if (this.level().isClientSide) { return InteractionResult.CONSUME; } else { if (!player.getAbilities().instabuild) { itemStack.shrink(1); } if (!ForgeEventFactory.onAnimalTame(this, player)) { if (!this.level().isClientSide) { super.tame(player); this.navigation.recomputePath(); this.setTarget(null); this.level().broadcastEntityEvent(this, (byte) 7); setSitting(false); } } return InteractionResult.SUCCESS; } } if (isTame() && !this.level().isClientSide && hand == InteractionHand.MAIN_HAND) { setSitting(!isSitting()); return InteractionResult.SUCCESS; } if (itemStack.getItem() == itemForTaming) { return InteractionResult.PASS; } return super.mobInteract(player, hand); } // Método para que el Brotecito pueda atacar a entidades hostiles excepto a: // - Ghasts // - Brotecitos que no son suyos // - jugadores que no pueden ser dañados @Override public boolean wantsToAttack(@NotNull LivingEntity pTarget, @NotNull LivingEntity pOwner) { if (!(pTarget instanceof Ghast)) { if (pTarget instanceof BrotecitoEntity brotecitoEntity) { return !brotecitoEntity.isTame() || brotecitoEntity.getOwner() != pOwner; } else if (pTarget instanceof Player && pOwner instanceof Player && !((Player)pOwner).canHarmPlayer((Player)pTarget)) { return false; } else if (pTarget instanceof AbstractHorse && ((AbstractHorse)pTarget).isTamed()) { return false; } else { return !(pTarget instanceof TamableAnimal) || !((TamableAnimal)pTarget).isTame(); } } else { return false; } } @Override public boolean isAlliedTo(Entity pEntity) { if (this.isTame() && this.getOwner() != null) { return pEntity == this.getOwner(); } else { return super.isAlliedTo(pEntity); } } @Override public void readAdditionalSaveData(CompoundTag tag) { super.readAdditionalSaveData(tag); setSitting(tag.getBoolean("isSitting")); } @Override public void addAdditionalSaveData(CompoundTag tag) { super.addAdditionalSaveData(tag); tag.putBoolean("isSitting", this.isSitting()); } // Método para que el Brotecito pueda sentarse y levantarse @Override protected void defineSynchedData() { super.defineSynchedData(); this.entityData.define(SITTING, false); } public void setSitting(boolean sitting) { this.entityData.set(SITTING, sitting); this.setOrderedToSit(sitting); } public boolean isSitting() { return this.entityData.get(SITTING); } @Override public Team getTeam() { return super.getTeam(); } public boolean canBeLeashed(Player player) { return false; } @Override public void setTame(boolean tamed) { super.setTame(tamed); if (tamed) { getAttribute(Attributes.MAX_HEALTH).setBaseValue(60.0D); getAttribute(Attributes.ATTACK_DAMAGE).setBaseValue(4D); getAttribute(Attributes.MOVEMENT_SPEED).setBaseValue(0.5f); } else { getAttribute(Attributes.MAX_HEALTH).setBaseValue(30.0D); getAttribute(Attributes.ATTACK_DAMAGE).setBaseValue(2D); getAttribute(Attributes.MOVEMENT_SPEED).setBaseValue(0.25f); } } public int getJumpDelay() { return this.random.nextInt(20) + 10; } protected void jumpFromGround() { Vec3 vec3 = this.getDeltaMovement(); this.setDeltaMovement(vec3.x, this.getJumpPower(), vec3.z); this.hasImpulse = true; } protected float getJumpPower() { return 0.42F; } protected SoundEvent getJumpSound() { return SoundEvents.SLIME_JUMP; } protected float getSoundVolume() { return 0.4F; } protected float getSoundPitch() { float f = this.isTiny() ? 1.4F : 0.8F; return ((this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F) * f; } public boolean isTiny() { return false; // Puedes ajustar esta lógica según las necesidades de tu entidad } public void dealDamage(LivingEntity target) { if (this.isAlive() && this.distanceToSqr(target) < this.getBbWidth() * this.getBbWidth() && this.hasLineOfSight(target)) { boolean flag = target.hurt(target.damageSources().mobAttack(this), (float) this.getAttributeValue(Attributes.ATTACK_DAMAGE)); if (flag) { this.doEnchantDamageEffects(this, target); this.playSound(SoundEvents.IRON_GOLEM_ATTACK, 1.0F, 1.0F); } } } } I look forward to hearing from you, thank you very much in advance.
    • You posted in an unrelated topic and triggered the anti-spam by posting your log directly, I've split your post into its own topic. Please read the FAQ.
    • 1.18.2 The crash report:  ---- Minecraft Crash Report ---- // Why did you do that? Time: 6/28/24, 6:05 PM Description: Rendering entity in world java.lang.IncompatibleClassChangeError: Method 'java.lang.String net.minecraft.world.item.Item.getArmorTexture(net.minecraft.world.item.ItemStack, net.minecraft.world.entity.Entity, net.minecraft.world.entity.EquipmentSlot, java.lang.String)' must be Methodref constant     at net.minecraft.world.item.Item.getArmorTexture(Item.java:557) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:factoryapi.mixins.json:IForgeItemInjector,pl:mixin:APP:ftblibrary-common.mixins.json:ItemMixin,pl:mixin:APP:bookshelf.common.mixins.json:item.AccessorItem,pl:mixin:APP:architectury-common.mixins.json:inject.MixinItem,pl:mixin:A}     at net.minecraftforge.client.ForgeHooksClient.getArmorTexture(ForgeHooksClient.java:210) ~[forge-1.18.2-40.2.0-universal.jar%2393!/:?] {re:classloading,re:mixin}     at net.minecraft.client.renderer.entity.layers.HumanoidArmorLayer.getArmorResource(HumanoidArmorLayer.java:142) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.renderer.entity.layers.HumanoidArmorLayer.m_117118_(HumanoidArmorLayer.java:60) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.renderer.entity.layers.HumanoidArmorLayer.m_6494_(HumanoidArmorLayer.java:37) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.renderer.entity.layers.HumanoidArmorLayer.m_6494_(HumanoidArmorLayer.java:23) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.renderer.entity.LivingEntityRenderer.m_7392_(LivingEntityRenderer.java:131) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.renderer.entity.MobRenderer.m_7392_(MobRenderer.java:45) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:classloading}     at net.minecraft.client.renderer.entity.MobRenderer.m_7392_(MobRenderer.java:18) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:classloading}     at net.minecraft.client.renderer.entity.EntityRenderDispatcher.m_114384_(EntityRenderDispatcher.java:129) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.renderer.LevelRenderer.m_109517_(LevelRenderer.java:1428) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.renderer.LevelRenderer.m_109599_(LevelRenderer.java:1219) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.renderer.GameRenderer.m_109089_(GameRenderer.java:1061) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.renderer.GameRenderer.m_109093_(GameRenderer.java:835) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.m_91383_(Minecraft.java:1046) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:bookshelf.common.mixins.json:client.AccessorMinecraft,pl:mixin:APP:mixins.ipnext.json:MixinMinecraftClient,pl:mixin:APP:architectury.mixins.json:MixinMinecraft,pl:mixin:APP:balm.mixins.json:MinecraftMixin,pl:mixin:APP:mixins.codechickenlib.json:MinecraftMixin,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.m_91374_(Minecraft.java:665) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:bookshelf.common.mixins.json:client.AccessorMinecraft,pl:mixin:APP:mixins.ipnext.json:MixinMinecraftClient,pl:mixin:APP:architectury.mixins.json:MixinMinecraft,pl:mixin:APP:balm.mixins.json:MinecraftMixin,pl:mixin:APP:mixins.codechickenlib.json:MinecraftMixin,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.main.Main.main(Main.java:205) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:classloading,pl:runtimedistcleaner:A}     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {}     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] {}     at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {}     at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] {}     at net.minecraftforge.fml.loading.targets.CommonClientLaunchHandler.lambda$launchService$0(CommonClientLaunchHandler.java:31) ~[fmlloader-1.18.2-40.2.0.jar%2317!/:?] {}     at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-9.1.3.jar%235!/:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) [modlauncher-9.1.3.jar%235!/:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) [modlauncher-9.1.3.jar%235!/:?] {}     at cpw.mods.modlauncher.Launcher.run(Launcher.java:106) [modlauncher-9.1.3.jar%235!/:?] {}     at cpw.mods.modlauncher.Launcher.main(Launcher.java:77) [modlauncher-9.1.3.jar%235!/:?] {}     at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) [modlauncher-9.1.3.jar%235!/:?] {}     at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) [modlauncher-9.1.3.jar%235!/:?] {}     at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:149) [bootstraplauncher-1.0.0.jar:?] {} A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Render thread Stacktrace:     at net.minecraft.world.item.Item.getArmorTexture(Item.java:557) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:factoryapi.mixins.json:IForgeItemInjector,pl:mixin:APP:ftblibrary-common.mixins.json:ItemMixin,pl:mixin:APP:bookshelf.common.mixins.json:item.AccessorItem,pl:mixin:APP:architectury-common.mixins.json:inject.MixinItem,pl:mixin:A}     at net.minecraftforge.client.ForgeHooksClient.getArmorTexture(ForgeHooksClient.java:210) ~[forge-1.18.2-40.2.0-universal.jar%2393!/:?] {re:classloading,re:mixin}     at net.minecraft.client.renderer.entity.layers.HumanoidArmorLayer.getArmorResource(HumanoidArmorLayer.java:142) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.renderer.entity.layers.HumanoidArmorLayer.m_117118_(HumanoidArmorLayer.java:60) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.renderer.entity.layers.HumanoidArmorLayer.m_6494_(HumanoidArmorLayer.java:37) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.renderer.entity.layers.HumanoidArmorLayer.m_6494_(HumanoidArmorLayer.java:23) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.renderer.entity.LivingEntityRenderer.m_7392_(LivingEntityRenderer.java:131) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.renderer.entity.MobRenderer.m_7392_(MobRenderer.java:45) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:classloading}     at net.minecraft.client.renderer.entity.MobRenderer.m_7392_(MobRenderer.java:18) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:classloading}     at net.minecraft.client.renderer.entity.EntityRenderDispatcher.m_114384_(EntityRenderDispatcher.java:129) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.renderer.LevelRenderer.m_109517_(LevelRenderer.java:1428) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.renderer.LevelRenderer.m_109599_(LevelRenderer.java:1219) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.renderer.GameRenderer.m_109089_(GameRenderer.java:1061) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} -- Entity being rendered -- Details:     Entity Type: minecraft:zombie (net.minecraft.world.entity.monster.Zombie)     Entity ID: 224     Entity Name: Zombie     Entity's Exact location: -362.88, 16.12, 204.47     Entity's Block location: World: (-363,16,204), Section: (at 5,0,12 in -23,1,12; chunk contains blocks -368,-64,192 to -353,319,207), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,-64,0 to -1,319,511)     Entity's Momentum: -0.09, -0.08, 0.00     Entity's Passengers: []     Entity's Vehicle: null Stacktrace:     at net.minecraft.client.renderer.entity.EntityRenderDispatcher.m_114384_(EntityRenderDispatcher.java:129) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.renderer.LevelRenderer.m_109517_(LevelRenderer.java:1428) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.renderer.LevelRenderer.m_109599_(LevelRenderer.java:1219) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.renderer.GameRenderer.m_109089_(GameRenderer.java:1061) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.renderer.GameRenderer.m_109093_(GameRenderer.java:835) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.m_91383_(Minecraft.java:1046) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:bookshelf.common.mixins.json:client.AccessorMinecraft,pl:mixin:APP:mixins.ipnext.json:MixinMinecraftClient,pl:mixin:APP:architectury.mixins.json:MixinMinecraft,pl:mixin:APP:balm.mixins.json:MinecraftMixin,pl:mixin:APP:mixins.codechickenlib.json:MinecraftMixin,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.m_91374_(Minecraft.java:665) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:bookshelf.common.mixins.json:client.AccessorMinecraft,pl:mixin:APP:mixins.ipnext.json:MixinMinecraftClient,pl:mixin:APP:architectury.mixins.json:MixinMinecraft,pl:mixin:APP:balm.mixins.json:MinecraftMixin,pl:mixin:APP:mixins.codechickenlib.json:MinecraftMixin,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.main.Main.main(Main.java:205) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:classloading,pl:runtimedistcleaner:A}     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {}     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] {}     at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {}     at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] {}     at net.minecraftforge.fml.loading.targets.CommonClientLaunchHandler.lambda$launchService$0(CommonClientLaunchHandler.java:31) ~[fmlloader-1.18.2-40.2.0.jar%2317!/:?] {}     at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-9.1.3.jar%235!/:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) [modlauncher-9.1.3.jar%235!/:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) [modlauncher-9.1.3.jar%235!/:?] {}     at cpw.mods.modlauncher.Launcher.run(Launcher.java:106) [modlauncher-9.1.3.jar%235!/:?] {}     at cpw.mods.modlauncher.Launcher.main(Launcher.java:77) [modlauncher-9.1.3.jar%235!/:?] {}     at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) [modlauncher-9.1.3.jar%235!/:?] {}     at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) [modlauncher-9.1.3.jar%235!/:?] {}     at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:149) [bootstraplauncher-1.0.0.jar:?] {} -- Renderer details -- Details:     Assigned renderer: net.minecraft.client.renderer.entity.ZombieRenderer@608aa474     Location: -82.50,-55.50,12.82 - World: (-83,-56,12), Section: (at 13,8,12 in -6,-4,0; chunk contains blocks -96,-64,0 to -81,319,15), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,-64,0 to -1,319,511)     Rotation: 88.59375     Delta: 0.8799957 Stacktrace:     at net.minecraft.client.renderer.entity.EntityRenderDispatcher.m_114384_(EntityRenderDispatcher.java:129) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.renderer.LevelRenderer.m_109517_(LevelRenderer.java:1428) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.renderer.LevelRenderer.m_109599_(LevelRenderer.java:1219) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.renderer.GameRenderer.m_109089_(GameRenderer.java:1061) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.renderer.GameRenderer.m_109093_(GameRenderer.java:835) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.m_91383_(Minecraft.java:1046) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:bookshelf.common.mixins.json:client.AccessorMinecraft,pl:mixin:APP:mixins.ipnext.json:MixinMinecraftClient,pl:mixin:APP:architectury.mixins.json:MixinMinecraft,pl:mixin:APP:balm.mixins.json:MinecraftMixin,pl:mixin:APP:mixins.codechickenlib.json:MinecraftMixin,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.m_91374_(Minecraft.java:665) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:bookshelf.common.mixins.json:client.AccessorMinecraft,pl:mixin:APP:mixins.ipnext.json:MixinMinecraftClient,pl:mixin:APP:architectury.mixins.json:MixinMinecraft,pl:mixin:APP:balm.mixins.json:MinecraftMixin,pl:mixin:APP:mixins.codechickenlib.json:MinecraftMixin,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.main.Main.main(Main.java:205) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:classloading,pl:runtimedistcleaner:A}     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {}     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] {}     at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {}     at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] {}     at net.minecraftforge.fml.loading.targets.CommonClientLaunchHandler.lambda$launchService$0(CommonClientLaunchHandler.java:31) ~[fmlloader-1.18.2-40.2.0.jar%2317!/:?] {}     at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-9.1.3.jar%235!/:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) [modlauncher-9.1.3.jar%235!/:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) [modlauncher-9.1.3.jar%235!/:?] {}     at cpw.mods.modlauncher.Launcher.run(Launcher.java:106) [modlauncher-9.1.3.jar%235!/:?] {}     at cpw.mods.modlauncher.Launcher.main(Launcher.java:77) [modlauncher-9.1.3.jar%235!/:?] {}     at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) [modlauncher-9.1.3.jar%235!/:?] {}     at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) [modlauncher-9.1.3.jar%235!/:?] {}     at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:149) [bootstraplauncher-1.0.0.jar:?] {} -- Affected level -- Details:     All players: 1 total; [LocalPlayer['Kindanooby'/112, l='ClientLevel', x=-280.36, y=70.00, z=191.65]]     Chunk stats: 961, 611     Level dimension: minecraft:overworld     Level spawn location: World: (-16,75,16), Section: (at 0,11,0 in -1,4,1; chunk contains blocks -16,-64,16 to -1,319,31), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,-64,0 to -1,319,511)     Level time: 21046 game time, 31968 day time     Server brand: forge     Server type: Integrated singleplayer server Stacktrace:     at net.minecraft.client.multiplayer.ClientLevel.m_6026_(ClientLevel.java:407) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:mixin,pl:runtimedistcleaner:A,re:classloading,pl:mixin:APP:architectury.mixins.json:MixinClientLevel,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.m_91354_(Minecraft.java:2262) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:bookshelf.common.mixins.json:client.AccessorMinecraft,pl:mixin:APP:mixins.ipnext.json:MixinMinecraftClient,pl:mixin:APP:architectury.mixins.json:MixinMinecraft,pl:mixin:APP:balm.mixins.json:MinecraftMixin,pl:mixin:APP:mixins.codechickenlib.json:MinecraftMixin,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.Minecraft.m_91374_(Minecraft.java:682) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:mixin,pl:accesstransformer:B,pl:runtimedistcleaner:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:bookshelf.common.mixins.json:client.AccessorMinecraft,pl:mixin:APP:mixins.ipnext.json:MixinMinecraftClient,pl:mixin:APP:architectury.mixins.json:MixinMinecraft,pl:mixin:APP:balm.mixins.json:MinecraftMixin,pl:mixin:APP:mixins.codechickenlib.json:MinecraftMixin,pl:mixin:A,pl:runtimedistcleaner:A}     at net.minecraft.client.main.Main.main(Main.java:205) ~[client-1.18.2-20220404.173914-srg.jar%2388!/:?] {re:classloading,pl:runtimedistcleaner:A}     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {}     at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] {}     at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {}     at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] {}     at net.minecraftforge.fml.loading.targets.CommonClientLaunchHandler.lambda$launchService$0(CommonClientLaunchHandler.java:31) ~[fmlloader-1.18.2-40.2.0.jar%2317!/:?] {}     at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-9.1.3.jar%235!/:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:53) [modlauncher-9.1.3.jar%235!/:?] {}     at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:71) [modlauncher-9.1.3.jar%235!/:?] {}     at cpw.mods.modlauncher.Launcher.run(Launcher.java:106) [modlauncher-9.1.3.jar%235!/:?] {}     at cpw.mods.modlauncher.Launcher.main(Launcher.java:77) [modlauncher-9.1.3.jar%235!/:?] {}     at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26) [modlauncher-9.1.3.jar%235!/:?] {}     at cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23) [modlauncher-9.1.3.jar%235!/:?] {}     at cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:149) [bootstraplauncher-1.0.0.jar:?] {} -- Last reload -- Details:     Reload number: 1     Reload reason: initial     Finished: Yes     Packs: Default, Mod Resources -- System Details -- Details:     Minecraft Version: 1.18.2     Minecraft Version ID: 1.18.2     Operating System: Windows 10 (amd64) version 10.0     Java Version: 17.0.1, Microsoft     Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Microsoft     Memory: 1467234992 bytes (1399 MiB) / 2954887168 bytes (2818 MiB) up to 4294967296 bytes (4096 MiB)     CPUs: 12     Processor Vendor: GenuineIntel     Processor Name: 13th Gen Intel(R) Core(TM) i7-1355U     Identifier: Intel64 Family 6 Model 186 Stepping 3     Microarchitecture: unknown     Frequency (GHz): 2.61     Number of physical packages: 1     Number of physical CPUs: 10     Number of logical CPUs: 12     Graphics card #0 name: Intel(R) Iris(R) Xe Graphics     Graphics card #0 vendor: Intel Corporation (0x8086)     Graphics card #0 VRAM (MB): 128.00     Graphics card #0 deviceId: 0xa7a1     Graphics card #0 versionInfo: DriverVersion=31.0.101.5522     Memory slot #0 capacity (MB): 8192.00     Memory slot #0 clockSpeed (GHz): 6.40     Memory slot #0 type: Unknown     Memory slot #1 capacity (MB): 8192.00     Memory slot #1 clockSpeed (GHz): 6.40     Memory slot #1 type: Unknown     Virtual memory max (MB): 21995.87     Virtual memory used (MB): 10986.19     Swap memory total (MB): 5888.00     Swap memory used (MB): 87.83     JVM Flags: 4 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xss1M -Xmx4096m -Xms256m     Launched Version: forge-40.2.0     Backend library: LWJGL version 3.2.2 SNAPSHOT     Backend API: Intel(R) Iris(R) Xe Graphics GL version 3.2.0 - Build 31.0.101.5522, Intel     Window size: 1024x768     GL Caps: Using framebuffer using OpenGL 3.2     GL debug messages:      Using VBOs: Yes     Is Modded: Definitely; Client brand changed to 'forge'; Server brand changed to 'forge'     Type: Integrated Server (map_client.txt)     Graphics mode: fancy     Resource Packs: vanilla, mod_resources     Current Language: English (US)     CPU: 12x 13th Gen Intel(R) Core(TM) i7-1355U     Server Running: true     Player Count: 1 / 8; [ServerPlayer['Kindanooby'/112, l='ServerLevel[a]', x=-280.36, y=70.00, z=191.65]]     Data Packs: vanilla, mod:tconstruct (incompatible), mod:libipn (incompatible), mod:enchdesc (incompatible), mod:mousetweaks (incompatible), mod:toolstats (incompatible), mod:tinkerslevellingaddon, mod:wthit (incompatible), mod:betterfpsdist (incompatible), mod:kotlinforforge, mod:sophisticatedcore (incompatible), mod:mantle (incompatible), mod:gravestone (incompatible), mod:journeymap, mod:badpackets (incompatible), mod:inventoryhud (incompatible), mod:ftbultimine (incompatible), mod:bookshelf, mod:sophisticatedbackpacks (incompatible), mod:fps (incompatible), mod:constructionwand, mod:inventoryprofilesnext (incompatible), mod:betterfurnacesreforged, mod:architectury (incompatible), mod:factory_api, mod:ftblibrary (incompatible), mod:balm (incompatible), mod:forge, mod:fastleafdecay, mod:codechickenlib (incompatible), mod:enderstorage (incompatible), mod:refinedstorage, mod:jei (incompatible), mod:refinedstorageaddons, mod:ironchest, mod:craftingtweaks (incompatible), mod:appleskin (incompatible)     World Generation: Experimental     ModLauncher: 9.1.3+9.1.3+main.9b69c82a     ModLauncher launch target: forgeclient     ModLauncher naming: srg     ModLauncher services:           mixin PLUGINSERVICE           eventbus PLUGINSERVICE           slf4jfixer PLUGINSERVICE           object_holder_definalize PLUGINSERVICE           runtime_enum_extender PLUGINSERVICE           capability_token_subclass PLUGINSERVICE           accesstransformer PLUGINSERVICE           runtimedistcleaner PLUGINSERVICE           mixin TRANSFORMATIONSERVICE           fml TRANSFORMATIONSERVICE      FML Language Providers:          [email protected]         javafml@null         [email protected]         lowcodefml@null     Mod List:          client-1.18.2-20220404.173914-srg.jar             |Minecraft                     |minecraft                     |1.18.2              |DONE      |Manifest: a1:d4:5e:04:4f:d3:d6:e0:7b:37:97:cf:77:b0:de:ad:4a:47:ce:8c:96:49:5f:0a:cf:8c:ae:b2:6d:4b:8a:3f         TConstruct-1.18.2-3.6.4.113.jar                   |Tinkers' Construct            |tconstruct                    |3.6.4.113           |DONE      |Manifest: NOSIGNATURE         libIPN-forge-1.18.2-4.0.2.jar                     |libIPN                        |libipn                        |4.0.2               |DONE      |Manifest: NOSIGNATURE         EnchantmentDescriptions-Forge-1.18.2-10.0.12.jar  |EnchantmentDescriptions       |enchdesc                      |10.0.12             |DONE      |Manifest: eb:c4:b1:67:8b:f9:0c:db:dc:4f:01:b1:8e:61:64:39:4c:10:85:0b:a6:c4:c7:48:f0:fa:95:f2:cb:08:3a:e5         MouseTweaks-forge-mc1.18-2.21.jar                 |Mouse Tweaks                  |mousetweaks                   |2.21                |DONE      |Manifest: NOSIGNATURE         ToolStats-Forge-1.18.2-9.0.4.jar                  |ToolStats                     |toolstats                     |9.0.4               |DONE      |Manifest: eb:c4:b1:67:8b:f9:0c:db:dc:4f:01:b1:8e:61:64:39:4c:10:85:0b:a6:c4:c7:48:f0:fa:95:f2:cb:08:3a:e5         TinkersLevellingAddon-1.18.2-1.3.0.jar            |Tinkers' Levelling Addon      |tinkerslevellingaddon         |1.3.0               |DONE      |Manifest: NOSIGNATURE         wthit-forge-4.13.6.jar                            |wthit                         |wthit                         |4.13.6              |DONE      |Manifest: NOSIGNATURE         betterfpsdist-1.18.2-1.5.jar                      |betterfpsdist mod             |betterfpsdist                 |1.18.2-1.5          |DONE      |Manifest: NOSIGNATURE         kffmod-3.12.0.jar                                 |Kotlin For Forge              |kotlinforforge                |3.12.0              |DONE      |Manifest: NOSIGNATURE         sophisticatedcore-1.18.2-0.6.4.604.jar            |Sophisticated Core            |sophisticatedcore             |1.18.2-0.6.4.604    |DONE      |Manifest: NOSIGNATURE         Mantle-1.18.2-1.9.50.jar                          |Mantle                        |mantle                        |1.9.50              |DONE      |Manifest: NOSIGNATURE         gravestone-1.18.2-1.0.1.jar                       |Gravestone Mod                |gravestone                    |1.18.2-1.0.1        |DONE      |Manifest: NOSIGNATURE         journeymap-1.18.2-5.9.8-forge.jar                 |Journeymap                    |journeymap                    |5.9.8               |DONE      |Manifest: NOSIGNATURE         badpackets-forge-0.1.3.jar                        |Bad Packets API               |badpackets                    |0.1.3               |DONE      |Manifest: NOSIGNATURE         inventoryhud.forge.1.18.2-3.4.22.jar              |Inventory HUD+(Forge edition) |inventoryhud                  |3.4.22              |DONE      |Manifest: NOSIGNATURE         ftb-ultimine-forge-1802.3.4-build.93.jar          |FTB Ultimine                  |ftbultimine                   |1802.3.4-build.93   |DONE      |Manifest: NOSIGNATURE         Bookshelf-Forge-1.18.2-13.3.56.jar                |Bookshelf                     |bookshelf                     |13.3.56             |DONE      |Manifest: eb:c4:b1:67:8b:f9:0c:db:dc:4f:01:b1:8e:61:64:39:4c:10:85:0b:a6:c4:c7:48:f0:fa:95:f2:cb:08:3a:e5         sophisticatedbackpacks-1.18.2-3.20.2.1036.jar     |Sophisticated Backpacks       |sophisticatedbackpacks        |1.18.2-3.20.2.1036  |DONE      |Manifest: NOSIGNATURE         FPS-Monitor-1.18.2-1.2.1.jar                      |FPS Monitor                   |fps                           |1.2.1               |DONE      |Manifest: NOSIGNATURE         constructionwand-1.18.2-2.9.jar                   |Construction Wand             |constructionwand              |1.18.2-2.9          |DONE      |Manifest: NOSIGNATURE         InventoryProfilesNext-forge-1.18.2-1.10.10.jar    |Inventory Profiles Next       |inventoryprofilesnext         |1.10.10             |DONE      |Manifest: NOSIGNATURE         BetterFurnaces-1.18.2-1.0-forge.jar               |Better Furnaces Reforged      |betterfurnacesreforged        |1.0                 |DONE      |Manifest: NOSIGNATURE         architectury-4.12.94-forge.jar                    |Architectury                  |architectury                  |4.12.94             |DONE      |Manifest: NOSIGNATURE         FactoryAPI-1.18.2-2.0-forge.jar                   |Factory API                   |factory_api                   |2.0                 |DONE      |Manifest: NOSIGNATURE         ftb-library-forge-1802.3.11-build.177.jar         |FTB Library                   |ftblibrary                    |1802.3.11-build.177 |DONE      |Manifest: NOSIGNATURE         balm-3.2.6.jar                                    |Balm                          |balm                          |3.2.6               |DONE      |Manifest: NOSIGNATURE         forge-1.18.2-40.2.0-universal.jar                 |Forge                         |forge                         |40.2.0              |DONE      |Manifest: 84:ce:76:e8:45:35:e4:0e:63:86:df:47:59:80:0f:67:6c:c1:5f:6e:5f:4d:b3:54:47:1a:9f:7f:ed:5e:f2:90         appleskin-forge-mc1.18.2-2.5.1.jar                |AppleSkin                     |appleskin                     |2.5.1+mc1.18.2      |DONE      |Manifest: NOSIGNATURE         FastLeafDecay-28.jar                              |FastLeafDecay                 |fastleafdecay                 |28                  |DONE      |Manifest: NOSIGNATURE         CodeChickenLib-1.18.2-4.1.4.488-universal.jar     |CodeChicken Lib               |codechickenlib                |4.1.4.488           |DONE      |Manifest: 31:e6:db:63:47:4a:6e:e0:0a:2c:11:d1:76:db:4e:82:ff:56:2d:29:93:d2:e5:02:bd:d3:bd:9d:27:47:a5:71         EnderStorage-1.18.2-2.9.0.182-universal.jar       |EnderStorage                  |enderstorage                  |2.9.0.182           |DONE      |Manifest: 31:e6:db:63:47:4a:6e:e0:0a:2c:11:d1:76:db:4e:82:ff:56:2d:29:93:d2:e5:02:bd:d3:bd:9d:27:47:a5:71         refinedstorage-1.10.6.jar                         |Refined Storage               |refinedstorage                |1.10.6              |DONE      |Manifest: NOSIGNATURE         jei-1.18.2-forge-10.2.1.1005.jar                  |Just Enough Items             |jei                           |10.2.1.1005         |DONE      |Manifest: NOSIGNATURE         refinedstorageaddons-0.8.2.jar                    |Refined Storage Addons        |refinedstorageaddons          |0.8.2               |DONE      |Manifest: NOSIGNATURE         ironchest-1.18.2-13.2.11.jar                      |Iron Chests                   |ironchest                     |1.18.2-13.2.11      |DONE      |Manifest: NOSIGNATURE         craftingtweaks-forge-1.18.2-14.0.9.jar            |CraftingTweaks                |craftingtweaks                |14.0.9              |DONE      |Manifest: NOSIGNATURE     Crash Report UUID: a4aa04e4-ee00-4b0c-97da-5ba2f8eda372     FML: 40.2     Forge: net.minecraftforge:40.2.0
  • Topics

×
×
  • Create New...

Important Information

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