Jump to content

iLaysChipz

Members
  • Posts

    9
  • Joined

  • Last visited

Recent Profile Visitors

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

iLaysChipz's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Gotcha, thank you for letting me know! I honestly had no idea. I think I'm going to try and create a universal setup method like I saw in Cadiboo's example. I'm still getting an error with this second argument for the method EntityType.Builder.create(entityClassIn, factoryIn). I think the problem is because I'm not sure what to pass for the first argument of the constructor, which is asking for an EntityType. All the vanilla mobs pass in final static instances of themselves which is hella confusing to me. Does anyone know what the first argument for EntityLivingBase should be for a custom entity that extends it?
  2. Actually, yeah. What he said. The method I used was to have a thin block occupy multiple faces at once. Just use a DirectionProperty
  3. Lucky for you I just finished doing this for my own mod lol. The best way to do this is by adding 6 boolean properties to the blockstate, and using the resource blockstate json to rotate the model depending on which boolean is true https://minecraft.gamepedia.com/Model#Block_states EDIT: Use a direction property
  4. I thought so, but I'm getting an error I'm not sure how to resolve. It says The type EntityTest does not define EntityTest(World) that is applicable here. If I look to EntitySlime, I see it's constructors defined as: protected EntitySlime(EntityType<?> p_i48552_1_, World p_i48552_2_) { super(p_i48552_1_, p_i48552_2_); this.moveHelper = new EntitySlime.SlimeMoveHelper(this); } public EntitySlime(World worldIn) { this(EntityType.SLIME, worldIn); } where SLIME is defined in EntityType as a constant as: public static final EntityType<EntityTest> TEST = EntityType.register("test", EntityType.Builder.create(EntityTest.class, EntityTest::new)); So now I have my code looking like: public class EntityList { public static final EntityType<EntityTest> TEST = EntityType.register("test", EntityType.Builder.create(EntityTest.class, EntityTest::new)); } // ============================================================================================================================================= //... protected EntityTest(World world) { this(EntityList.TEST,world); } protected EntityTest(EntityType<?> type, World world) { super(type, world); this.moveHelper = new EntityMoveHelper(this); } //... I'm sorry if these are dumb questions, I've always learned best by example, and I'm having a lot of trouble trying to extrapolate the in-between bits on my own. Am I supposed to be casting the function as a factory somehow? Or is there extra parts needed in the constructor?
  5. Hey Cadiboo, thank you so much for replying! I couldn't find EntityEntry, but based on the post here, I think it's been updated to EntityType<T>. It seems the create method needs a class (Class<? extends T> entityClassIn) and world (Function<? super World, ? extends T> factoryIn). So far I've been able to get this to run: @SubscribeEvent public static void registerEntities(final RegistryEvent.Register<EntityType<?>> event) { event.getRegistry().registerAll ( EntityList.test = EntityType.Builder.create(EntityTest.class, null).build("test").setRegistryName(MODID,"test") ); } However, I can't summon the mob, and I can't find how to make a new spawn egg. Could you point me in the right direction on where to look? Again, thank you so much for taking the time to help me out
  6. I edited the last post with all the relevant code. All I'm trying to create for now is a cube that can be attacked and defeated like any other mob. If I can get to that point I think I can handle everything else I need from there. Any resources on where I can find this information on my own would be really helpful. I'm sorry for all the trouble as I know this is a lot to ask. Thank you all for your input so far. I do appreciate it.
  7. Can I get an example for what the register event should look like? Right now I have something that looks like Register Event @Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD) public static class RegistryEvents { @SubscribeEvent public static void registerEntities(final RegistryEvent.Register<EntityType<?>> event) { event.getRegistry().registerAll ( EntityList.test = EntityType.Builder.create(EntityTest.class, i_have_no_idea_what_goes_here); ); } } Entity Class public class EntityTest extends EntityLiving implements IMob { protected EntityTest(EntityType<?> type, World world) { super(type, world); } @Override protected void registerAttributes() { super.registerAttributes(); this.getAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(0.0D); this.getAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.0D); this.getAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(0.0D); this.getAttribute(SharedMonsterAttributes.ARMOR).setBaseValue(1.0D); this.getAttribute(SharedMonsterAttributes.MAX_HEALTH).setBaseValue(30.0D); } @Override public boolean isAIDisabled() { return true; } @Override public boolean canBeCollidedWith() { return true; } } Model Class @OnlyIn(Dist.CLIENT) public class ModelTest extends ModelBase { protected ModelRenderer test_cube; public ModelTest(float scale) { test_cube = new ModelRenderer(this); test_cube.addBox(-4.0F, 16.0F, -4.0F, 8, 8, 8); test_cube.setRotationPoint(0f, 8f, 0f); } @Override public void render(Entity entity, float f1, float f2, float f3, float f4, float f5, float scale) { this.setRotationAngles(f1, f2, f3, f4, f5, scale, entity); test_cube.render(scale); } } Render Class @OnlyIn(Dist.CLIENT) public class RenderTest extends RenderLiving<EntityTest> { private static final ResourceLocation TEST_TEXTURES = new ResourceLocation("textures/entity/slime/slime.png"); public RenderTest(RenderManager renderer) { super(renderer, new ModelTest(16), 0.25f); } protected ResourceLocation getEntityTexture(EntityTest entity) { return TEST_TEXTURES; } } Class holding entity declaration public class EntityList { public static EntityType<EntitySilkNest> silk_nest; } Also, I'm a little lost on how to connect the renderer, model, and entity together
  8. Hey all, I'm pretty new to modding and am having trouble learning all the basics. I've figured out how to register and create my own blocks/items as well as how to give them custom properties and such. However, I'm having trouble figuring out how to get started with creating and registering entities. Does anyone have any examples they can post on how to register and create custom entities in 1.13.2? Thank you!
  9. Hello, please forgive me as I'm pretty new at this. I'm trying to create several blocks which adjust jump height of entities on top of them (including players and mobs), but do not adjust vertical velocity upon collision or pass through. Are there any methods to reliably detect when an entity is jumping or do I have to try and homebrew it? Thank you!
×
×
  • Create New...

Important Information

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