Jump to content

Recommended Posts

Posted

Hey guys, im kinda new here, hoping im posting it on the right section:

 

I got this mod with tons of animal mobs from MC 1.12 and im trying to update it to 1.15, but im having a lot of problems with code change,

Im trying to make my mob here climb walls like a Spider, so what i did was copy the Spider climb files, but for some reason it gives error on this line:

 

private static final DataParameter<Byte> CLIMBING = EntityDataManager.createKey(CapuchinBrownEntity.class, DataSerializers.BYTE);

 

the CapuchinBrownEntity part will give the error below, and if i replace it with SpiderEntity the mode wont appear in-game (off course):

 

error: method createKey in class EntityDataManager cannot be applied to given types;
private static final DataParameter<Byte> CLIMBING = EntityDataManager.createKey(CapuchinBrownEntity.class, DataSerializers.BYTE); 
                                                                        ^ 
  required: Class<? extends Entity>,IDataSerializer<T> 
  found: Class<CapuchinBrownEntity>,IDataSerializer<Byte> 
  reason: cannot infer type-variable(s) T 
    (argument mismatch; Class<CapuchinBrownEntity> cannot be converted to Class<? extends Entity>) 
  where T is a type-variable: 
    T extends Object declared in method <T>createKey(Class<? extends Entity>,IDataSerializer<T>) 
1 error 
> Task :compileJava FAILED 
FAILURE: Build failed with an exception.

 

im trying to make my little monkey mobs climb blocks :D

Posted (edited)
58 minutes ago, TheGreyGhost said:

Hi

 

Does your CapuchinBrownEntity extend the vanilla Entity?

 

If you think it does, show your CapuchinBrownEntity class?

 

-TGG

 

Quote

@WizardAnimalsPlusModElements.ModElement.Tag
public class CapuchinBrownEntity extends WizardAnimalsPlusModElements.ModElement {
	
	
	public static EntityType entity = null;

	private static final DataParameter<Byte> CLIMBING = EntityDataManager.createKey(CapuchinBrownEntity.class, DataSerializers.BYTE);
	
	public CapuchinBrownEntity(WizardAnimalsPlusModElements instance) {
		super(instance, 4);
		FMLJavaModLoadingContext.get().getModEventBus().register(this);
	}

 

im very new on java yet, i hope is this part you mention

Edited by ninjawizard
Posted
10 hours ago, ninjawizard said:

WizardAnimalsPlusModElements.ModElement

Stop using MCreator.

  • Confused 1

It's sad how much time mods spend saying "x is no longer supported on this forum. Please update to a modern version of Minecraft to receive support".

Posted (edited)
4 hours ago, Novârch said:

Stop using MCreator.

sorry but i was asking for help only.. i want to learn on my own way.

Edited by ninjawizard
  • Guest locked this topic
Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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