Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

OrangeVillager61

Members
  • 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. So nbt.setString("120", "120") is what you mean?
  4. 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?
  5. 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}++;
  6. Could you have multiple blocks with 16 blockstates each to support them all?
  7. 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...
  8. Sorry, for the late post (the forums were being moved). I'm on 1.8.9.
  9. 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});
  10. 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).
  11. Huh, yeah I wrote my mod differently so sorry.
  12. Because of derpy code and typos that fixed the bug but created a crash. Then I fixed the crash. Thank for the help!
  13. 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; }
  14. (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; }
  15. Um, do you need to register the renders in the common proxy? My mod works fine without it.
  16. #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.
  17. 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).
  18. Also remove the registerRenders from the common proxy.
  19. I know I have an instance and but it give me an error: The final field World.isRemote cannot be assigned.
  20. Doing that gives me an error that World.isRemote is not a static field.
  21. So I should add an if statement like this: if (World.isRemote = false){ }
  22. I know that it is true due it changing the blockstate, I just don't really understand diesieben07's reply.
  23. 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; }
  24. Thank you! My blockstates code had a few mistakes that I didn't know (as this is my first time creating blockstates). }

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.