Everything posted by QuantumSoul
-
[1.15.2] TileEntityRenderer syncing
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 ?
-
[1.15.2] 0 rotations entity still rotated
Anyone ?
-
[1.15.2] 0 rotations entity still rotated
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
-
[1.15.2] BlockRender#renderBlock IModelData
Thank you :)
-
[1.15.2] BlockRender#renderBlock IModelData
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
-
[1.15.2] BlockRender#renderBlock IModelData
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.
-
[1.15.2] Custom mobs spawning in air
Do I need the deferredWorkQueue ?
-
Should I add server check on item ?
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;
-
[1.15.2] Custom mobs spawning in air
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;
-
[1.15.2] Custom mobs spawning in air
Well how do I do it because there is no ForgeRegistry for it ? EDIT: I did try with canSpawn, didn't work.
-
[1.15.2] Custom mobs spawning in air
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.
-
Should I add server check on item ?
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;
-
[1.15.2] How to modify vanilla block properties?
In you registering event, you make a new block with those new properties and you register it using its vanilla name;
-
[1.15.2] Add spawn conditions to MobEntity
I need the BlockPos but canSpawn only has IWorld and SpawnReason
-
mods.toml missing metadata for modid test
Give the log
-
[1.15.2] Add spawn conditions to MobEntity
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.
-
[1.15.2] Biome registered before EntityTypes
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 ?
-
[1.15.2][Solved] DeferredRegistry can't stack BlockItems
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
-
[1.15.2] [Solved] Stuck while loading custom dimension
Isn't the same than what I sent ?
-
[1.15.2] [Solved] Stuck while loading custom dimension
How did you do for the dimensiontype tho?
-
[1.15.2] [Solved] Stuck while loading custom dimension
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); }
-
Two rabbits spawn instead of one
Thanks. And what about the two rabbits ? EDIT: Solved
-
Two rabbits spawn instead of one
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:
-
Adding custom properties to blockstates
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
-
Adding custom properties to blockstates
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));
IPS spam blocked by CleanTalk.