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.

Leomelonseeds

Forge Modder
  • Joined

  • Last visited

Everything posted by Leomelonseeds

  1. What do you mean it doesn't work? Any errors in the console?
  2. Check out the other threads about rendering an object above a block(hint:google sesrch)
  3. If so implement IInventory on your TileEntity.
  4. What do you mean are you trying to put some item in with a hopper?
  5. U got any errors in the console? Post them.
  6. Also, how do I detect of a item has been placed inside the GUI?
  7. Or you could use EnumBlockRenderType#getRenderType to return EnumBlockRenderType.MODEL. The above post is probably for the better tho.
  8. Well just like a block you have to put the json files for blockstates and models.
  9. Yes, in the same place you register your mod blocks and items
  10. Hey clowcadia check out the GreyGhosts MinecraftByExample it has lots of good examples of items and blocks. https://github.com/TheGreyGhost/MinecraftByExample
  11. RenderingRegistry.registerEntityRenderingHandler(EntityDeer.class, new RenderDeer()); this is deprecated. Use this: RenderingRegistry.registerEntityRenderingHandler(EntityDeer.class, RenderDeer::new); And PUT IT IN PREINIT.
  12. @TheSunCatPlease turn signatures on and read Draco18s'. Its nice. So how about my problems?
  13. @Choonster That will probably be a big help with my Grill. Thanks!
  14. OK it works now. A few problems: I know my entity is invisible right now, but when I tried to destroy it, it also destroys the block behind it, and after a few seconds drops the block. How would I set a break time, and what is wrong with it?
  15. Well I already have the ModSecurityCamera up there. If you want the entity class, here: package com.leomelonseeds.moarstuff.entity; import javax.annotation.Nullable; import com.leomelonseeds.moarstuff.items.Moditems; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityHanging; import net.minecraft.entity.item.EntityPainting; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.SoundEvents; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class EntityCamera extends EntityHanging { public EntityCamera(World worldIn) { super(worldIn); } public EntityCamera(World worldIn, BlockPos pos, EnumFacing facing) { super(worldIn, pos); } @SideOnly(Side.CLIENT) public EntityCamera(World worldIn, BlockPos pos, EnumFacing facing, String title) { this(worldIn, pos, facing); this.updateFacingWithBoundingBox(facing); } @Override public int getWidthPixels() { return 12; } @Override public int getHeightPixels() { return 12; } @Override public void onBroken(@Nullable Entity brokenEntity) { if (this.worldObj.getGameRules().getBoolean("doEntityDrops")) { this.playSound(SoundEvents.BLOCK_STONE_BREAK, 1.0F, 1.0F); if (brokenEntity instanceof EntityPlayer) { EntityPlayer entityplayer = (EntityPlayer)brokenEntity; if (entityplayer.capabilities.isCreativeMode) { return; } } this.entityDropItem(new ItemStack(Moditems.camera), 0.0F); } } @Override public void playPlaceSound() { this.playSound(SoundEvents.BLOCK_STONE_HIT, 1.0F, 1.0F); } public void setLocationAndAngles(double x, double y, double z, float yaw, float pitch) { this.setPosition(x, y, z); } /** * Set the position and rotation values directly without any clamping. */ @SideOnly(Side.CLIENT) public void setPositionAndRotationDirect(double x, double y, double z, float yaw, float pitch, int posRotationIncrements, boolean teleport) { BlockPos blockpos = this.hangingPosition.add(x - this.posX, y - this.posY, z - this.posZ); this.setPosition((double)blockpos.getX(), (double)blockpos.getY(), (double)blockpos.getZ()); } }
  16. Im making a security camera, that has to be an entity since I'm going to implement a feature to spectate it. I'm extending entityHanging since paintings are similar, but I am getting a crash when I try placing it down. ModSecurityCamera: package com.leomelonseeds.moarstuff.items; import javax.annotation.Nullable; import com.leomelonseeds.moarstuff.entity.EntityCamera; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityHanging; import net.minecraft.entity.item.EntityItemFrame; import net.minecraft.entity.item.EntityPainting; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public class ModSecurityCamera extends Item { private final Class <? extends EntityHanging > hangingEntityClass; public ModSecurityCamera(Class <? extends EntityHanging > entityClass) { this.hangingEntityClass = entityClass; this.setCreativeTab(Moditems.moarStuff); this.setUnlocalizedName("security_camera"); } /** * Called when a Block is right-clicked with this Item */ public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { BlockPos blockpos = pos.offset(facing); if (facing != EnumFacing.DOWN && facing != EnumFacing.UP && playerIn.canPlayerEdit(blockpos, facing, stack)) { EntityHanging entityhanging = this.createEntity(worldIn, blockpos, facing); if (entityhanging != null && entityhanging.onValidSurface()) { if (!worldIn.isRemote) { entityhanging.playPlaceSound(); worldIn.spawnEntityInWorld(entityhanging); } --stack.stackSize; } return EnumActionResult.SUCCESS; } else { return EnumActionResult.FAIL; } } @Nullable private EntityHanging createEntity(World worldIn, BlockPos pos, EnumFacing clickedSide) { return (EntityHanging)(this.hangingEntityClass == EntityCamera.class ? new EntityCamera(worldIn, pos, clickedSide): null); } } Error: [20:11:16] [Server thread/FATAL]: Error executing task java.util.concurrent.ExecutionException: java.lang.NullPointerException at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:1.8.0_25] at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[?:1.8.0_25] at net.minecraft.util.Util.runTask(Util.java:26) [Util.class:?] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:742) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:687) [MinecraftServer.class:?] at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:156) [IntegratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:536) [MinecraftServer.class:?] at java.lang.Thread.run(Thread.java:745) [?:1.8.0_25] Caused by: java.lang.NullPointerException at net.minecraft.entity.EntityHanging.onValidSurface(EntityHanging.java:147) ~[EntityHanging.class:?] at com.leomelonseeds.moarstuff.items.ModSecurityCamera.onItemUse(ModSecurityCamera.java:42) ~[ModSecurityCamera.class:?] at net.minecraftforge.common.ForgeHooks.onPlaceItemIntoWorld(ForgeHooks.java:780) ~[ForgeHooks.class:?] at net.minecraft.item.ItemStack.onItemUse(ItemStack.java:158) ~[ItemStack.class:?] at net.minecraft.server.management.PlayerInteractionManager.processRightClickBlock(PlayerInteractionManager.java:509) ~[PlayerInteractionManager.class:?] at net.minecraft.network.NetHandlerPlayServer.processRightClickBlock(NetHandlerPlayServer.java:706) ~[NetHandlerPlayServer.class:?] at net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock.processPacket(CPacketPlayerTryUseItemOnBlock.java:68) ~[CPacketPlayerTryUseItemOnBlock.class:?] at net.minecraft.network.play.client.CPacketPlayerTryUseItemOnBlock.processPacket(CPacketPlayerTryUseItemOnBlock.java:13) ~[CPacketPlayerTryUseItemOnBlock.class:?] at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:15) ~[PacketThreadUtil$1.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_25] at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_25] at net.minecraft.util.Util.runTask(Util.java:25) ~[Util.class:?] ... 5 more
  17. Im making a security camera that allows you to spectate it anytime, and a teleporter. For these questions you can message me.
  18. What do you mean is it that it still is black and pink or do you think that those codes are the same? If its the former, post all your jsons
  19. Post your json files again. Did we just post at the same time again??
  20. Nono. "parent":"yourmodid:block/tutorial_block" no need fot the texture
  21. Your mod id MUST be all lowercase.

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.