Posted December 7, 20204 yr I am using forge version 1.16.1-32.0.63 and I wanted to create my own custom entity. I did not know how to set the mutable attributes, so I looked it up, but every search directed me to roughly the same code: package com.gamingtiger.gttaa.entities; import com.sun.org.apache.xml.internal.utils.MutableAttrListImpl; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityType; import net.minecraft.entity.MobEntity; import net.minecraft.entity.ai.attributes.Attribute; import net.minecraft.entity.ai.attributes.AttributeModifierMap; import net.minecraft.nbt.CompoundNBT; import net.minecraft.network.IPacket; import net.minecraft.world.World; public class SuperZombieEntity extends Entity { public SuperZombieEntity(EntityType<?> entityTypeIn, World worldIn) { super(entityTypeIn, worldIn); } public static AttributeModifierMap.MutableAttribute setCustomAttribute() { return MobEntity.func_233666_p_().createMutableAttribute(Attribute.MAX_HEALTH, 100.0D); } @Override protected void registerData() { } @Override protected void readAdditional(CompoundNBT compound) { } @Override protected void writeAdditional(CompoundNBT compound) { } @Override public IPacket<?> createSpawnPacket() { return null; } } The problem is that the ".createMutableAttribute" does not exist and I don't know how to solve this. I tested this with a passive mob and a mobentity.
December 8, 20204 yr You have to put it inside the GlobalEntityTypeAttributes Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port
December 8, 20204 yr Author 1 hour ago, Beethoven92 said: You have to put it inside the GlobalEntityTypeAttributes Where can I find those attributes, I looked but don't know where to find it
December 8, 20204 yr GlobalEntityTypeAttributes is a class, take a look inside it. Also: @Override public IPacket<?> createSpawnPacket() { return null; } This should not return null Edited December 8, 20204 yr by Beethoven92 Check out the port of the BetterEnd fabric mod (WIP): https://www.curseforge.com/minecraft/mc-mods/betterend-forge-port
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.