Started by
gustavowizard123
on
Topic category: Help with Minecraft modding (Java Edition)
guys im trying to set a climbing code (from spider mob) to my custom mob, i was able to do on 1.12 but nto now...
private static final DataParameter<Byte> CLIMBING = EntityDataManager.createKey(CapuchinBrownEntity.class, DataSerializers.BYTE);
//CLIMB CODE 1.15 WIP
protected PathNavigator createNavigator(World worldIn) {
return new ClimberPathNavigator(this, worldIn);
}
protected void registerData() {
super.registerData();
this.dataManager.register(CLIMBING, (byte)0);
}
public void tick() {
super.tick();
if (!this.world.isRemote) {
this.setBesideClimbableBlock(this.collidedHorizontally);
}
}
public boolean isBesideClimbableBlock() {
return (this.dataManager.get(CLIMBING) & 1) != 0;
}
public void setBesideClimbableBlock(boolean climbing) {
byte b0 = this.dataManager.get(CLIMBING);
if (climbing) {
b0 = (byte)(b0 | 1);
} else {
b0 = (byte)(b0 & -2);
}
this.dataManager.set(CLIMBING, b0);
}
/// CLIMB CODE
this is what i did so far; the first call line goes just below the mob first line, like on the spider file, the rest below, i took this code from the spider mob, so i must be doing something wrong
The errors it gives:
actually the problem is only here:
private static final DataParameter<Byte> CLIMBING = EntityDataManager.createKey(CapuchinBrownEntity.class, DataSerializers.BYTE);
When i use SpiderEntity class it works but the model wotn appear off course, so im missing something here to make it work for my entity