-
Posts
82 -
Joined
-
Last visited
Everything posted by QuantumSoul
-
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
QuantumSoul replied to QuantumSoul's topic in Modder Support
Anyone ? -
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
QuantumSoul replied to QuantumSoul's topic in Modder Support
Thank you :) -
[1.15.2] BlockRender#renderBlock IModelData
QuantumSoul replied to QuantumSoul's topic in Modder Support
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 -
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.
-
Do I need the deferredWorkQueue ?
-
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;
-
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;
-
Well how do I do it because there is no ForgeRegistry for it ? EDIT: I did try with canSpawn, didn't work.
-
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.
-
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?
QuantumSoul replied to rrmTV's topic in Modder Support
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
QuantumSoul replied to QuantumSoul's topic in Modder Support
I need the BlockPos but canSpawn only has IWorld and SpawnReason -
mods.toml missing metadata for modid test
QuantumSoul replied to Mateoox600's topic in Modder Support
Give the log -
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.
-
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 ?
-
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
QuantumSoul replied to Budschie's topic in Modder Support
Isn't the same than what I sent ? -
[1.15.2] [Solved] Stuck while loading custom dimension
QuantumSoul replied to Budschie's topic in Modder Support
How did you do for the dimensiontype tho? -
[1.15.2] [Solved] Stuck while loading custom dimension
QuantumSoul replied to Budschie's topic in Modder Support
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); } -
Thanks. And what about the two rabbits ? EDIT: Solved
-
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
QuantumSoul replied to Dizzylizard22's topic in Modder Support
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
QuantumSoul replied to Dizzylizard22's topic in Modder Support
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));