Jump to content

OrangeVillager61

Members
  • Posts

    339
  • Joined

  • Last visited

Everything posted by OrangeVillager61

  1. The code above should use the Minecraft texture...
  2. Yeah... with some work and wonkiness I can get (Items.spawn_egg, 1, 120) to work, but it is not really a good way. Anyhow, if .setTagCompound(nbt)) returns a void, is there alternative or I convert it?
  3. nbt.string requires two strings. So nbt.setString("120"); (120 is the villager's entity id) wouldn't work. What do I use as a second string?
  4. Yes, I looked at it. Okay I got to this, but eclipse says that for "new ItemStack(Items.spawn_egg).setTagCompound(nbt))" it cannot convert from ItemStack to void. net.minecraft.nbt.NBTTagCompound nbt = new net.minecraft.nbt.NBTTagCompound(); nbt.setString("EntityVillager", "120"); ItemStack VillagerEgg = new ItemStack(Items.spawn_egg).setTagCompound(nbt)); GameRegistry.addRecipe(VillagerEgg); new Object[] {"BBB", "VAE", "BBB", Character.valueOf('B'), MoDropsItems.biomatter, Character.valueOf('A'), MoDropsItems.adaptive_biomatter, Character.valueOf('V'), MoDropsBlocks.villager_nose, Character.valueOf('E'), Items.emerald}++;
  5. Could you have multiple blocks with 16 blockstates each to support them all?
  6. So like this? GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, "EntityVillager") or net.minecraft.nbt.NBTTagCompound nbt = new net.minecraft.nbt.NBTTagCompound(); nbt.setString("EntityVillager", "120"); GameRegistry.addRecipe(new ItemStack(Items.spawn_egg.setTagCompound(nbt)) I don't really know nbt...
  7. Sorry, for the late post (the forums were being moved). I'm on 1.8.9.
  8. How to craft villager spawn eggs? I using the entity id as the id type (like salmon) but this does not work. GameRegistry.addRecipe(new ItemStack(Items.spawn_egg, 1, 120), new Object[] {"BBB", "VAE", "BBB", Character.valueOf('B'), MoDropsItems.biomatter, Character.valueOf('A'), MoDropsItems.adaptive_biomatter, Character.valueOf('V'), MoDropsBlocks.villager_nose, Character.valueOf('E'), Items.emerald});
  9. When I try to build with gradlew, all I get is: Gradlew build Gradlew build Gradlew build Gradlew build Gradlew build Gradlew build until the end of time. What should I do? (I hope I am not making a dumb noob mistake).
  10. Because of derpy code and typos that fixed the bug but created a crash. Then I fixed the crash. Thank for the help!
  11. What I meant by This is some other code go to the next // is different code unrelated with my problem. I adjusted the code however it still does not work. @Override public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) { if (state.getValue(TYPE) == EnumType.EMPTY){ ItemStack itemstack = playerIn.getCurrentEquippedItem(); if (itemstack.getItem() == Items.water_bucket){ worldIn.setBlockState(pos, (this.blockState.getBaseState().withProperty(TYPE, EnumType.FULL))); if (!playerIn.capabilities.isCreativeMode) { playerIn.destroyCurrentEquippedItem(); return true; } return false; } } if (!worldIn.isRemote){ if (state.getValue(TYPE) == EnumType.FULL){ worldIn.setBlockState(pos, (this.blockState.getBaseState().withProperty(TYPE, EnumType.EMPTY))); EntityItem entityitem1 = new EntityItem(worldIn, hitX, hitY, hitZ, new ItemStack(Items.bucket, 1)); EntityItem entityitem2 = new EntityItem(worldIn, hitX, hitY, hitZ, new ItemStack(OraniaItems.bucket_of_brine, 1)); worldIn.spawnEntityInWorld(entityitem1); worldIn.spawnEntityInWorld(entityitem2); return true; } } return true; }
  12. (I put the entire onBlockActivated code) @Override public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) { // This is some other code go to the next // if (state.getValue(TYPE) == EnumType.EMPTY){ ItemStack itemstack = playerIn.getCurrentEquippedItem(); if (itemstack.getItem() == Items.water_bucket){ worldIn.setBlockState(pos, (this.blockState.getBaseState().withProperty(TYPE, EnumType.FULL))); if (!playerIn.capabilities.isCreativeMode) { playerIn.destroyCurrentEquippedItem(); return true; } } } //This is the code I'm using if (!worldIn.isRemote){ if (state.getValue(TYPE) == EnumType.FULL){ worldIn.setBlockState(pos, (this.blockState.getBaseState().withProperty(TYPE, EnumType.EMPTY))); EntityItem entityitem1 = new EntityItem(worldIn, hitX, hitY, hitZ, new ItemStack(Items.bucket, 1)); EntityItem entityitem2 = new EntityItem(worldIn, hitX, hitY, hitZ, new ItemStack(OraniaItems.bucket_of_brine, 1)); worldIn.spawnEntityInWorld(entityitem1); worldIn.spawnEntityInWorld(entityitem2); return true; } } return false; }
  13. Um, do you need to register the renders in the common proxy? My mod works fine without it.
  14. #facepalm (I wanted to type the double equals but typed one) and I'm a Java noob and I agree that !worldin.isRemote is better. However getting the items is still not working.
  15. I already typed that (worldIn.isRemote = false) a while go. The error is he final field World.isRemote cannot be assigned (It red underlined isRemote).
  16. Also remove the registerRenders from the common proxy.
  17. I know I have an instance and but it give me an error: The final field World.isRemote cannot be assigned.
  18. Doing that gives me an error that World.isRemote is not a static field.
  19. So I should add an if statement like this: if (World.isRemote = false){ }
  20. I know that it is true due it changing the blockstate, I just don't really understand diesieben07's reply.
  21. Hello! I am trying to get it to when I right-click the block (a block from my mod) the blockstate is full it will change to empty and it will drop two items. However when I right-click the block the items don't appear. The code below: @Override public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) { if (state.getValue(TYPE) == EnumType.FULL){ worldIn.setBlockState(pos, (this.blockState.getBaseState().withProperty(TYPE, EnumType.EMPTY))); EntityItem entityitem1 = new EntityItem(worldIn, hitX, hitY, hitZ, new ItemStack(Items.bucket, 1)); EntityItem entityitem2 = new EntityItem(worldIn, hitX, hitY, hitZ, new ItemStack(OraniaItems.bucket_of_brine, 1)); worldIn.spawnEntityInWorld(entityitem1); worldIn.spawnEntityInWorld(entityitem2); return true; } return false; }
  22. Thank you! My blockstates code had a few mistakes that I didn't know (as this is my first time creating blockstates). }
×
×
  • Create New...

Important Information

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