Jump to content

QuantumSoul

Members
  • Posts

    82
  • Joined

  • Last visited

Everything posted by QuantumSoul

  1. Hey, I have a TileEntity whose value increase each tick. It drops an item and the value is set to 0 when I right click on the block. I have a TileEntityRenderer who prints that value on my block. The TER works fine except when I click on the block, the value keep increasing on the render. But I know it's zero because I doesn't drop. Thanks in advance EDIT: I guess I have to send a packet, is there any vanilla packet for that ?
  2. Hey, In my custom entity, I set its rotations to 0: if (entity.getPosX() % 1 != 0.0D || entity.getPosY() % 1 != 0.0D || entity.getPosZ() % 1 != 0.0D || entity.rotationYaw != 0.0F || entity.rotationPitch != 0F || entity.rotationYawHead != 0.0F) { entity.moveToBlockPosAndAngles(entity.getPosition(), 0.0F, 0.0F); entity.setRotationYawHead(0.0F); } But sometimes, the entity is still rotated with a yaw of ~35°. I made an item to check those rotations in game and it says they are all 0.0F. EDIT: I rechecked and there are two chat messages, idk which one is the server ? But the first one gives nonnull yaw while the second one gives 0.0F
  3. I change my entity in its goals but the render function is always called with the old value. I guess I should send a packet but Im not sure
  4. Hey, My entity mimics the block below it: BlockRender#renderBlock is deprecated, I have to add an IModelData. What should I put for a basic block ? Thanks in advance.
  5. Do I need the deferredWorkQueue ?
  6. I checked that method on vanilla examples and they do the check to summon entities but don't to shrink itemstack. But it seemed weird that's why I asked;
  7. Well, I'd like to prevent my mobs from spawning in air. My question is how do I do so ? I saw that vanilla mobs use EntitySpawnPlacementRegistry so that's why I asked; I just want to know what is the best method do it; I already do; The function above is called using DefferedWorkQueue#runLater;
  8. Well how do I do it because there is no ForgeRegistry for it ? EDIT: I did try with canSpawn, didn't work.
  9. Hi, My mobs spawn in the sky and die. Here is how I register them in the FMLCommonStetupEvent BiomeInit.BIOMES.getEntries().stream().map(RegistryObject::get).filter(biome -> biome != BiomeInit.VOID_BIOME.get()).forEach(b -> { List<Biome.SpawnListEntry> creatures = b.getSpawns(EntityClassification.CREATURE); creatures.add(new Biome.SpawnListEntry(EntityInit.ONE.get(), 50, 1, 3)); creatures.add(new Biome.SpawnListEntry(EntityInit.ZERO.get(), 50, 1, 3)); List<Biome.SpawnListEntry> monsters = b.getSpawns(EntityClassification.MONSTER); monsters.add(new Biome.SpawnListEntry(EntityInit.BUG.get(), 15, 3, 4)); monsters.add(new Biome.SpawnListEntry(EntityInit.VIRUS.get(), 15, 1, 2)); }); I tried overriding the CreatureEntity#getPathWeight but I feel like it's not the right thing to do and it didn't work.
  10. Here's my custom item Item#onItemRightClick override: @Override public ActionResult<ItemStack> onItemRightClick(World worldIn, PlayerEntity playerIn, Hand handIn) { ItemStack stack = playerIn.getHeldItem(handIn); if(!(playerIn.abilities.isCreativeMode)) stack.shrink(1); return ActionResult.resultConsume(stack); } Should I add a !world.isRemote ? If so, how what ActionResult should I return ? Thanks in advance;
  11. In you registering event, you make a new block with those new properties and you register it using its vanilla name;
  12. I need the BlockPos but canSpawn only has IWorld and SpawnReason
  13. Hi, I used CreatureEntity#getBlockPathWeight to change spawn conditions of my other mobs but this one entity extends the SlimeEntity which is not a CreatureEntity so I don't have that method. Unfortunately, there is no ForgeRegistry for minecraft EntitySpawnPlacementRegistry What can I do ? Thanks in advance.
  14. Hi, I tried adding my custom mobs to the spawn list of my custom biome but it crashes: java.lang.NullPointerException: Registry Object not present on my entitytype I guess it's because EntityTypes are registered after Biomes so what can I do ? BinaryMod.java EntityInit.java BiomeInit.java BinaryBiome.java Thanks in advance. Btw how do I add spawn eggs ?
  15. Hey, Since I use deferredregistry for my blocks, I can't stack them anymore. BlockInit.java MyMod.java I use the same Item.Properties for my basic items and they all can be stacked Item.Properties BASE_PROP = new Item.Properties().maxStackSize(64).group(ItemGroupInit.instance); I tried with and without .maxStackSize(64) Thanks in advance. EDIT: Solved, using the same Item.Properties for all items made my AxeItem set all other Items maxStackSize to 1
  16. Isn't the same than what I sent ?
  17. How did you do for the dimensiontype tho?
  18. Your DimensionType is returned when using the forge registerDimensionsEvent public static DimensionType MY_DIMENSION_TYPE; @SubscribeEvent public static void registerDimensions(RegisterDimensionsEvent event) { if(DimensionType.byName(resourceLocation) == null) MY_DIMENSION_TYPE = DimensionManager.registerDimension(resourceLocation, modDimension, null, true); }
  19. Thanks. And what about the two rabbits ? EDIT: Solved
  20. Hello, My block summons a rabbit when generated but 1. There are always two rabbits instead of one 2. It spawns in the side of the block and thus suffocates. How can I make them spawn in the middle of the block ? My block:
  21. It is in the Block class public ActionResultType onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult blockRayTraceResult) For the decrementation, you get the value with: value = state.get(property) you set it with worldIn.setBlockState(pos, state.with(property, value)); You can figure the rest by yourself
  22. You can override those. Mojang use deprecation too much. The really deprecated ones have comments from forge. Btw, If you don't have the onBlockActivated in your list you should use the latest forge version instead of the recommended one. To set the value: world.setBlockState(pos, this.getDefaultState.with(LIFE, value));
×
×
  • Create New...

Important Information

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