Jump to content

Military Police15

Members
  • Posts

    8
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Military Police15's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. ah, apologies, i'm modding for 1.14 also I'm working on the registry right now, i have yet to work on the render class or plug my mob into the main class
  2. This is what i've got for my entitylist class. I'm having trouble with 'public static final EntityType jeff = new EntityType(Jeff.class, reference.MOD_ID + "jeff");' it gives the error of: 'The constructor EntityType(Class<Jeff>, String) is undefined' I also, like i said don't know how to add the spawn egg for my entity. the code I went off of used 'setEgg' to set the spawn egg, but I think it's out of date because auto complete didn't make it show up public class EntityList { public static final EntityType jeff = new EntityType(Jeff.class, reference.MOD_ID + "jeff"); public static final EntityType[] ENTITIES = new EntityType[] { jeff }; static { jeff.setRegistryName(reference.MOD_ID, "jeff"); } }
  3. I've made some decent headway, but i'm at a loss as to how i set the entity's spawn egg
  4. That's what I figured, but I wanted to make sure. Thank you guys so much for all the help!
  5. I would use different tutorials, but there aren't very many others out there, at least i haven't really been able to find any (edit) I feel dumb, i meant I need to register a mob entity, not a block entity, are they different or would they register the same way?
  6. I followed one of Harry talk's videos to create my own entity, and i have the entity itself setup and ready to go, but I'm not sure how to register it within the game as the forge/gradle file 'EntityRegistry' doesn't appear within my files, and despite several attempts to update, refresh the dependencies, and move the files manually I have had no success. I'm assuming that I have to find a new way to register the entities, whether in the entity's class itself or by using a different line of code, but i'm at a loss as to how to go about that as i'm rather new to the modding scene.
  7. I figured I could just learn it as I went along, but i have been having a lot of problems with figuring out what to use where, so I'll try to learn more about it tomorrow
  8. I Found some of the code parts you were talking about, and implemented them into my code, but i have a small problem with 'this.damageEntity', which is giving the error 'Entity Living Base is not applicable for the arguments (EntityPlayer, float) public class Jeff extends EntityMob { private EntityPlayer player; private int explosionRadius = 3; protected void initEntityAI() { this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(1, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); this.tasks.addTask(2, new EntityAILookIdle(this)); this.tasks.addTask(3, new EntityAIOpenDoor(this, false)); } public float getEyeHeight() { return 0.5F; } protected void applyEntityAttributes() { this.getCreatureAttribute(); this.getCreatureAttribute(); } protected Jeff(EntityType<?> type, World p_i48553_2_) { super(type, p_i48553_2_); this.getAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D); } public boolean attackEntityFrom(DamageSource source, float amount) { if (this.damageEntity(this.player, amount)) { return true; World createExplosion; } else { return false; } } }
  9. So I've been trying to make a mob for my mod, and the concept is this: if the mob gets hurt by the player, the mob explodes, but the mob would still live. I've got most of the AI and attributes down, I'm just having trouble finding a way to code it so when the mob is attacked by the player it explodes. Any help would be appreciated, here is what i've got so far public class Jeff extends EntityMob { private int explosionRadius = 3; protected void initEntityAI() { this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(1, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); this.tasks.addTask(2, new EntityAILookIdle(this)); this.tasks.addTask(3, new EntityAIOpenDoor(this, false)); } public float getEyeHeight() { return 0.5F; } protected void applyEntityAttributes() { this.getCreatureAttribute(); this.getCreatureAttribute(); } protected Jeff(EntityType<?> type, World p_i48553_2_) { super(type, p_i48553_2_); this.getAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.25D); } }
×
×
  • Create New...

Important Information

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