Jump to content

J0WAY

Members
  • Posts

    63
  • Joined

  • Last visited

Everything posted by J0WAY

  1. Just typing so someone can see thisJust typing so someone can see this
  2. I keep getting an error when starting that says the mod file bin/main has mods that were not found and in warning I have errors like failed to load a valid resourcepackinfo
  3. So i logged into eclipse and every single one of my classes have errors and in referenced lib the mc classes don't exist anymore or nothing which i don't know what to do
  4. So i made my biome classes and i know there is topBlock, fillerBlock but there only for the top layers so they wouldn't work, Is there anyway i can make it so in my biome my stone generates like the normal stone, And if there is a youtube tutorial on this or forums post related to my problem for 1.12.2 you can link me that and ill look into it!.
  5. Also i fixed the problem, It was nothing to do with setItemStackToSlot it was because i needed to add in renderbarbarian { this.addLayer(new LayerBipedArmor(this)); this.addLayer(new LayerHeldItem(this)); } so turns out it wasn't anything to do with itemstack just like when i made the most and said if there's any render method but yeah, thanks for the help anyways. Also your ModelClass for your mob needs to extend ModelBiped if you want it to work!.
  6. Yeah i do get it now and i really should of learned basic java before coding my mob which ill do and ill come back to this once i learn some more about basic java.
  7. public class EntityBarbarian extends EntityMob { public EntityBarbarian(World worldIn) { super(worldIn); this.setSize(0.6F, 1.95F); this.setHealth(50); } @Override protected void initEntityAI() { super.initEntityAI(); this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, false)); this.tasks.addTask(8, new EntityAIWander(this, 0.6D)); this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 3.0F, 1.0F)); this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F)); this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true, new Class[] {EntityVindicator.class})); this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityVillager.class, true)); this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityIronGolem.class, true)); } @Override protected void applyEntityAttributes() { super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(6.0D); this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.23000000417232513D); this.getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(48.0D); } @Override public float getEyeHeight() { return 1.6F; } @Override public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, IEntityLivingData livingdata) { return super.onInitialSpawn(difficulty, livingdata); } @Override public void setItemStackToSlot(EntityEquipmentSlot slotIn, ItemStack stack) { super.setItemStackToSlot(slotIn.MAINHAND, new ItemStack (ModItems.BARBARIAN_SWORD)); } }
  8. Well to be honest at this point i really don't know what i'm doing and it's not working still when i call those methods so if you could show me an example of what to do that would be amazing, Also are mobs suppose to have inventories because if they are then my doesn't have one and i think the main problem in this is it can't find which hand to set the sword to so that's why it isn't spawning with the mob and it just keeps denying it, Again i don't know how to fix because like i said before i'm only good at blocks and items and i just got into making mobs like 3 days ago.
  9. Which if you mean call @Override public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, IEntityLivingData livingdata) { // TODO Auto-generated method stub return super.onInitialSpawn(difficulty, livingdata); } What would i replace difficulty and livingdata with?.
  10. This will probably sound really stupid but i get the first part called setItemStackToSlot in my EntityBarbarian but what do you mean by in EntityLiving#onInitialSpawn. It's probably really simple and i'm just confused or somethin.
  11. I was just saying that because you said still not using override, And my whole point of making this post is i need help with the mob and i'm asking why won't it spawn with a sword, To be honest i don't know any of the code to make the mob spawn with the sword so if you could tell me what to do so my mob can spawn with a sword that would be amazing!, Also yeah i do agree i should of learned more basic java before i jumped into this.
  12. It's because i was showing you where i only setup the sword for the mob and that method doesn't want override. Entity barbarian public class EntityBarbarian extends EntityMob { public EntityBarbarian(World worldIn) { super(worldIn); this.setSize(0.6F, 1.95F); this.setHealth(50); } @Override protected void initEntityAI() { super.initEntityAI(); this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, false)); this.tasks.addTask(8, new EntityAIWander(this, 0.6D)); this.tasks.addTask(9, new EntityAIWatchClosest(this, EntityPlayer.class, 3.0F, 1.0F)); this.tasks.addTask(10, new EntityAIWatchClosest(this, EntityLiving.class, 8.0F)); this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true, new Class[] {EntityVindicator.class})); this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityVillager.class, true)); this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityIronGolem.class, true)); } @Override protected void applyEntityAttributes() { super.applyEntityAttributes(); this.getEntityAttribute(SharedMonsterAttributes.ATTACK_DAMAGE).setBaseValue(6.0D); this.getEntityAttribute(SharedMonsterAttributes.MOVEMENT_SPEED).setBaseValue(0.23000000417232513D); this.getEntityAttribute(SharedMonsterAttributes.FOLLOW_RANGE).setBaseValue(48.0D); } @Override public float getEyeHeight() { return 1.6F; } protected void setEquipmentBasedOnDifficult(DifficultyInstance difficulty) { this.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(ModItems.BARBARIAN_SWORD)); } }
  13. I'm still kinda new to coding mobs so if you could show me an example on how to do it that would be amazing!.
  14. protected void setEquipmentBasedOnDifficult(DifficultyInstance difficulty) { this.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(ModItems.BARBARIAN_SWORD)); }
  15. Okay, But my main problem is why won't my sword spawn on my mob because i did just change it to the vanilla code and it still doesn't work.
  16. So i put protected void onInitialSpawn(DifficultyInstance difficulty) { this.setItemStackToSlot(EntityEquipmentSlot.MAINHAND, new ItemStack(ModItems.BARBARIAN_SWORD)); } in my entity class and i did try the one from the wither class and even tried Override with it but for some reason the sword just won't load in on the mobs hand and i don't know what method to use where to declare the mobs arm but if there's a way so my sword can load on my mob let me know!.
  17. So i have a question, How would i set the rotations for a mob like a barbarian the same as minecrafts normal walking rotations like the zombie or skeleton, I'm asking this because i tried setting them up with rotation x and all of that but both legs move at the same time and it looks kinda weird, If there's any way to make it so your custom mob has the same walking animation as a zombie or skeleton please let me know!.
  18. What kind of class code do you want me to post, Because i don't got my code on a github because it's no suppose to be public, Like all of the code for my entity classes and rendering handler or just rendering/model/texuture?.
  19. So i made a mob that's a barbarian and i setup all the classes for it and everything and i'm getting no errors in console when i load or spawn the mob but it keeps spawning like this: I don't know why so if somebody knows how to fix this problem please let me know, And all the render classes are fine and i even have another mob that spawns fine but this one for some reason isn't spawning good, And this is in 1.12.2.
  20. O sorry, Here is the pastebin of the startup and logging in and when it crashes https://pastebin.com/enySRiwx
  21. Cannot get property PropertyEnum{name=half, clazz=class net.minecraft.block.BlockSlab$EnumBlockHalf, values=[top, bottom]} as it does not exist in BlockStateContainer{block=supersurvival:crystal_slab_double, properties=[variant]}
  22. And if you take out the see through code it's normal and acts normal, But it's not see through like it should be.
  23. So i was making slabs and this one i have is called a "Crystal Slab" and it's see through kinda like a crystal so when i have been trying to do it, It keeps crashing like if i load into a world place it on the ground it has a see through effect all the way past bedrock, And if i place a slab on top of it, The game crashes, But if i place the top one first and the bottom one it acts normal, And btw when the game crashes when you load back in it's like if you were in spec mode but every block is gone and the game ends up crashing, If you know the problem please let me know because now i'm past my time for releasing alpha 2.0 for my mod lol. Heres the class for BlockSlabBase public abstract class BlockSlabBase extends BlockSlab { Block half; public static final PropertyEnum<Variant> VARIANT = PropertyEnum.<Variant>create("variant", Variant.class); public BlockSlabBase(String name, Material material, BlockSlab half) { super(material); setUnlocalizedName(name); setRegistryName(name); setCreativeTab(CreativeTabs.BUILDING_BLOCKS); this.useNeighborBrightness = !this.isDouble(); IBlockState state = this.blockState.getBaseState().withProperty(VARIANT, Variant.DEFAULT); if(!this.isDouble()) state = state.withProperty(HALF, EnumBlockHalf.BOTTOM); this.half = half; ModBlocks.BLOCKS.add(this); } @SideOnly(Side.CLIENT) public BlockRenderLayer getBlockLayer() { return BlockRenderLayer.TRANSLUCENT; } @Override public boolean isOpaqueCube(IBlockState state) { return false; } @SideOnly(Side.CLIENT) @Override public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) { IBlockState iblockstate = blockAccess.getBlockState(pos.offset(side)); Block block = iblockstate.getBlock(); if (blockState != iblockstate) { return true; } if (block == this) { return false; } return false; } @Override public Item getItemDropped(IBlockState state, Random rand, int fortune) { return Item.getItemFromBlock(half); } @Override public ItemStack getItem(World worldIn, BlockPos pos, IBlockState state) { return new ItemStack(half); } @Override public IBlockState getStateFromMeta(int meta) { IBlockState state = this.blockState.getBaseState().withProperty(VARIANT, Variant.DEFAULT); if(!this.isDouble()) state = state.withProperty(HALF, ((meta&8) != 0) ? EnumBlockHalf.TOP : EnumBlockHalf.BOTTOM); return state; } @Override public int getMetaFromState(IBlockState state) { int meta = 0; if(!this.isDouble() && state.getValue(HALF) == EnumBlockHalf.TOP) meta |= 8; return meta; } @Override protected BlockStateContainer createBlockState() { if(!this.isDouble()) return new BlockStateContainer(this, new IProperty[] {VARIANT, HALF}); else return new BlockStateContainer(this, new IProperty[] {VARIANT}); } @Override public String getUnlocalizedName(int meta) { return super.getUnlocalizedName(); } @Override public IProperty<?> getVariantProperty() { return VARIANT; } @Override public Comparable<?> getTypeForItem(ItemStack stack) { return Variant.DEFAULT; } public static enum Variant implements IStringSerializable { DEFAULT; @Override public String getName() { return "default"; } } }
  24. I fixed the problem but thanks for the advice.
×
×
  • Create New...

Important Information

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