Jump to content

Feroov

Members
  • Posts

    80
  • Joined

  • Last visited

Everything posted by Feroov

  1. Yea already figured it out ages ago, it's sad I can't delete the posts but still thank you appreciate it
  2. I have a custom entity, how can we create a texture on players screen when we ride our entity, think of like health bar for example (well basically anything/any texture)
  3. I swapped my entity to an animal while maintaining flying etc functionality (so it's no longer FlyingMob), they now spawn properly so that's kind of interesting I found out, still appreciate your help
  4. I'm having issues spawning my flying entity in my custom biome, heres what I have currently: Inside my biomes json: "spawners": { "creature": [ { "type": "frv:zephxen", "maxCount": 2, "minCount": 1, "weight": 10 } ] }, "spawn_costs": {}, How I'm calling the SpawnPlacementRegisterEvent: @SubscribeEvent public static void entitySpawnRestriction(SpawnPlacementRegisterEvent event) { event.register(EntitiesSTLCON.ZEPHXEN.get(), SpawnPlacements.Type.ON_GROUND, Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, Zephxen::checkZephxenSpawnRules, SpawnPlacementRegisterEvent.Operation.OR); } Finally this is how I registered the entity: public static final RegistryObject<EntityType<Zephxen>> ZEPHXEN = ENTITY_TYPES.register("zephxen", () -> EntityType.Builder.of(Zephxen::new, MobCategory.CREATURE) .sized(2.3f, 2.3f).canSpawnFarFromPlayer().clientTrackingRange(10) .build(new ResourceLocation(STLCON.MOD_ID, "zephxen").toString())); So the problem/bug that I have is that they do spawn when I teleport to that specific biome they're supposed to spawn, but they only spawn in that area that I've teleported, when I explore my biome further they don't spawn, even if I teleport couple thousand blocks and try again in a new biome, still nothing spawns. And also I did play around with weight and min/max spawn count, it is still the same story. I'm honestly not really sure what else am I missing, thank you in advance ๐Ÿ™
  5. So I've created a boss mob, whether it is naturally generated or spawned by the player, after some time it despawns, what can I do so that it doesn't despawn at all? Thanks in advance
  6. So I have two entities, one is an absolute passive, like an animal, when you hit them they run away, and the other variant is like a guard (two seperate entities, "Xeron" and "Xeron Guard"). So I did manage to make the guards neutral so that when I hit them, the rest of the guards come after the player (I followed how the wolf class is made, HurtByTarget etc). The main question or the problem is, is it possible to make it so that if I hit the normal passive entity, the guards are also alerted and come after the player? Thanks in advance
  7. I've actually fixed my issue, I no longer have floating trees on my pond, I still do see them but it's rare now and it's not really an issue, here is what I have if anyone ever stumbles a similar issue (Correct me if I have any mistakes) Placed feature: { "feature": "frv:xenos_pond", "placement": [ { "type": "minecraft:rarity_filter", "chance": 4 }, { "type": "minecraft:in_square" }, { "type": "minecraft:heightmap", "heightmap": "WORLD_SURFACE_WG" }, { "type": "minecraft:biome" } ] } Configured feature: { "type": "minecraft:lake", "config": { "barrier": { "type": "minecraft:simple_state_provider", "state": { "Name": "frv:xenosgrass_block" } }, "fluid": { "type": "minecraft:simple_state_provider", "state": { "Name": "minecraft:water", "Properties": { "level": "0" } } } } } And on our biome json where the feature is, this is the order I have: "features": [ [], [ "frv:xenos_pond_placed" ], [], [], [], [], [ "frv:uskium_placed", "frv:xenite_placed", "frv:astralite_placed" ], [], [ "frv:xenos_spring_placed" ], [ "frv:xenosphere_plants", "frv:xenos_placed" ], [] ]
  8. Yea I even put it in order actually, theres also a wiki related to this still no luck, in that case I guess I have the problem on my trees itself, I'll snoop around there and see, but thank you still appreciate it
  9. I have my custom trees etc, I created a simple pond for the surfaces but trees sometimes float etc, what should I be doing?
  10. You know how vanilla has the custom sound for example when we get full netherite set, how can we create our custom one?
  11. Since there's no cooldown the player will go on a constant loop on changing dimensions since the player is inside the block. Here's what I have: My portal block: @Override public void entityInside(BlockState blockState, Level level, BlockPos blockPos, Entity entity) { if(entity.isOnPortalCooldown()) { entity.setPortalCooldown(); } if(!entity.isOnPortalCooldown() && entity instanceof LivingEntity) { if (!level.isClientSide()) { if (!entity.isCrouching()) { MinecraftServer server = level.getServer(); if (server != null) { if (level.dimension() == DimensionsSTLCON.XENOSPHERE_KEY) { ServerLevel overWorld = server.getLevel(Level.OVERWORLD); if (overWorld != null) { entity.changeDimension(overWorld, new XenosphereTeleporter(blockPos, false)); } } else { ServerLevel serverLevel = server.getLevel(DimensionsSTLCON.XENOSPHERE_KEY); if (serverLevel != null) { entity.changeDimension(serverLevel, new XenosphereTeleporter(blockPos, true)); } } } } } } } And my teleporter: public class XenosphereTeleporter implements ITeleporter { public static BlockPos thisPos = BlockPos.ZERO; public static boolean insideDimension = true; public XenosphereTeleporter(BlockPos pos, boolean insideDim) { thisPos = pos; insideDimension = insideDim; } @Override public Entity placeEntity(Entity entity, ServerLevel currentWorld, ServerLevel destinationWorld, float yaw, Function<Boolean, Entity> repositionEntity) { entity = repositionEntity.apply(false); int y = 69; if (!insideDimension) { y = thisPos.getY(); } BlockPos destinationPos = new BlockPos(thisPos.getX(), y, thisPos.getZ()); int tries = 0; while ((destinationWorld.getBlockState(destinationPos).getMaterial() != Material.AIR) && !destinationWorld.getBlockState(destinationPos).canBeReplaced(Fluids.WATER) && destinationWorld.getBlockState(destinationPos.above()).getMaterial() != Material.AIR && !destinationWorld.getBlockState(destinationPos.above()).canBeReplaced(Fluids.WATER) && tries < 25) { destinationPos = destinationPos.above(2); tries++; } entity.teleportTo(destinationPos.getX(), destinationPos.getY(), destinationPos.getZ()); if (insideDimension) { boolean doSetBlock = true; for (BlockPos checkPos : BlockPos.betweenClosed(destinationPos.below(10).west(10).south(10), destinationPos.above(10).east(10).north(10))) { if (destinationWorld.getBlockState(checkPos).getBlock() instanceof XenosphereTeleporterBlock) { doSetBlock = false; break; } } if (doSetBlock) { destinationWorld.setBlock(destinationPos, BlocksSTLCON.XENOSPHERE_PORTAL.get().defaultBlockState(), 3); } } return entity; } } I've tried several ways but no luck, unfortunately, and ideas?
  12. Hey there, I basically have my planks.json in data>minecraft>tags>block>planks.json And I have this: { "replace": false, "values": [ "frv:xenos_planks" ] } Isn't this the way to use default vanilla recipes? (Basically, I want the custom plank to be able to craft like sticks, crafting table etc that sort of thing) Thank you in advance
  13. I first registered it like this: public static final RegistryObject<Block> XENOSGRASS_BLOCK = registerBlock("xenosgrass_block", () -> new GrassBlock(BlockBehaviour.Properties.copy(Blocks.GRASS_BLOCK).strength(0.6F).sound(SoundType.GRASS))); And for JSONS: Blockstate: { "variants": { "": { "model": "frv:block/xenosgrass_block" } } } Block: { "parent": "block/cube_all", "textures": { "all": "frv:block/xenosgrass_block" } } Item: { "parent": "frv:block/xenosgrass_block" } The problem is I can't seem to place vegetation on my block that's the main issue. I messed around with how I would register, forexample Properties.of() instead of copy, or Instead of a new GrassBlock, plain Block. Do I need to create a custom class that extends to GrassBlock and call it in my registry? OR is it some type of tag that I need to add on my data folder?
  14. I apologize I was very frustrated that day already not only for this but of personal real-life problems as well so please put yourself in my shoes, however, I managed to do everything so far since the last time we spoke, I actually did more digging and searching and found my solution before seeing your message just now but still I appreciate your help
  15. If you could, could you please guide me through I'd really appreciate it, do I call/register through an EventBusSubscriber?
  16. First off I register my dimension like so: public class DimensionsSTLCON { public static final ResourceKey<Level> XENOSPHERE_KEY = ResourceKey.create(Registries.DIMENSION, new ResourceLocation(STLCON.MOD_ID, "the_xenosphere")); public static final ResourceKey<DimensionType> XENOSPHERE_TYPE = ResourceKey.create(Registries.DIMENSION_TYPE, XENOSPHERE_KEY.registry()); public static void register() { System.out.println("Registering DimensionsSTLCON for " + STLCON.MOD_ID); } } Then I have found IForgeDimensionSpecialEffects/DimensionSpecialEffects might be the answer to my solution but how can I call/use the renderClouds method to my custom dimension? public class CustomDimensionSpecialEffects extends DimensionSpecialEffects implements IForgeDimensionSpecialEffects { public CustomDimensionSpecialEffects(float p_108866_, boolean p_108867_, SkyType p_108868_, boolean p_108869_, boolean p_108870_) { super(p_108866_, p_108867_, p_108868_, p_108869_, p_108870_); } @Override public boolean renderClouds(ClientLevel level, int ticks, float partialTick, PoseStack poseStack, double camX, double camY, double camZ, Matrix4f projectionMatrix) { return true; // Return true to prevent vanilla cloud rendering } @Override public Vec3 getBrightnessDependentFogColor(Vec3 p_108878_, float p_108879_) { return null; } @Override public boolean isFoggyAt(int p_108874_, int p_108875_) { return false; } } Thank you so much in advance have an amazing day
  17. Like you mentioned how I could make my own AbstractArrow, I actually went on creating my own AbstractHurtingProjectile since I think the previous one I made the testing purpose one was AbstractArrow if I recall. Everything is working as intended now so, thank you so much for your time appreciate it, and yes I had some issues regarding where it shoots, so I copied/used over ghast as you mentioned โ™ฅ
  18. I have a flying mob that basically moves like a ghast, I have a custom projectile, it is a AbstractArrow type not fireball, well my accuracy is not quite there yet, on some distances, it is perfectly accurate and on some distances inaccurate, this is my current attack goal: public static class RaybeamAttackGoal extends Goal { private final Celestroid mob; private final Celestroid rangedAttackMob; @Nullable private LivingEntity target; private int attackTime = -1; private int seeTime; private final int statecheck; private final double attackIntervalMin, attackIntervalMax, speedModifier; private final float attackRadius, attackRadiusSqr; public RaybeamAttackGoal(Celestroid celestroid, double speedIn, double dpsIn, float rangeIn, int state) { this(celestroid, speedIn, dpsIn, dpsIn, rangeIn, state); } public RaybeamAttackGoal(Celestroid gunswine, double speedIn, double atckIntervalMin, double atckIntervalMax, float atckRadius, int state) { this.rangedAttackMob = gunswine; this.mob = gunswine; this.speedModifier = speedIn; this.attackIntervalMin = atckIntervalMin; this.attackIntervalMax = atckIntervalMax; this.attackRadius = atckRadius; this.attackRadiusSqr = atckRadius * atckRadius; this.statecheck = state; this.setFlags(EnumSet.of(Flag.MOVE, Flag.LOOK)); } public boolean canUse() { LivingEntity livingentity = this.mob.getTarget(); if (livingentity != null && livingentity.isAlive()) { this.target = livingentity; return true; } else { return false; } } public boolean canContinueToUse() { return this.canUse() || !this.mob.getNavigation().isDone(); } public void stop() { this.target = null; this.seeTime = 0; this.attackTime = -1; } public boolean requiresUpdateEveryTick() { return true; } public void tick() { double d0 = this.mob.distanceToSqr(this.target.getX(), this.target.getY(), this.target.getZ()); boolean flag = this.mob.getSensing().hasLineOfSight(this.target); if (flag) { ++this.seeTime; } else { this.seeTime = 0; } if (!(d0 > (double)this.attackRadiusSqr) && this.seeTime >= 5) { this.mob.getNavigation().stop(); } else { this.mob.getNavigation().moveTo(this.target, this.speedModifier); } this.mob.getLookControl().setLookAt(this.target, 30.0F, 30.0F); if (--this.attackTime == 0) { if (!flag) { return; } float f = (float)Math.sqrt(d0) / this.attackRadius; float f1 = Mth.clamp(f, 0.1F, 1.0F); this.rangedAttackMob.performRangedAttack(this.target, f1); this.attackTime = Mth.floor(f * (float)(this.attackIntervalMax - this.attackIntervalMin) + (float)this.attackIntervalMin); } else if (this.attackTime < 0) { this.attackTime = Mth.floor(Mth.lerp(Math.sqrt(d0) / (double)this.attackRadius, (double)this.attackIntervalMin, (double)this.attackIntervalMax)); } } } public void performRangedAttack(LivingEntity livingEntity, float p_32142_) { RaygunBeam beam = new RaygunBeam(this.level, this); double d0 = livingEntity.getX() - this.getX(); double d1 = livingEntity.getY(-3.3333333333333333D) - beam.getY(); double d2 = livingEntity.getZ() - this.getZ(); double d3 = Math.sqrt(d0 * d0 + d2 * d2); beam.shoot(d0, d1 + d3 * (double)0.2F, d2, 1.6F,0f); this.playSound(SoundEventsSTLCON.RAYGUN_SHOOT.get(), 2.0F, 1.0F / (this.getRandom().nextFloat() * 0.4F + 0.8F)); this.level.addFreshEntity(beam); } What can I do or refactor so that the accuracy is basically like a fireball of the ghast, I tried actually creating a similar way of how ghast is made, so I did create before another projectile for testing purposes, which used same functionality as a fireball, then the accuracy was perfect as I wanted but obviously the projectile wouldn't do damage to the player. Thank you so much in advance cheers
  19. #Edit Apparently getDefaultInstance is maybe not what we're looking for, in that case what can we do?
  20. So I'm trying to add piercing by default already applied to my custom ranged weapon, I got this currently, I did this in the past but I forgot, I do remember it had something to do with getDefaultInstance: @Override public ItemStack getDefaultInstance() { ItemStack defaultInstance = new ItemStack(this); EnchantmentHelper.setEnchantments(Collections.singletonMap(Enchantments.PIERCING, 1), defaultInstance); return defaultInstance; } Thank you so much in advance
  21. Basically I've created my own new item (raygun) that has obviously same functionality as a bow etc, the only thing I have problem with is, you know when you're in first person and when you draw your bow you have the bow animation right? so I wanted to remove that which I did by doing this: @Override public UseAnim getUseAnimation(ItemStack stack) { return UseAnim.NONE; } This does fix my issue regarding first person animation, I don't want to have a bow animation in first person, however now the problem is on third person we don't have such "bow" like animation, I hope I can express myself, in short I want a bow animation only on thirdperson but not on first person. Thanks in advance
  22. So basically say I want my entity to attack the player every 3 seconds, do I modify something in the tick() method? Thank you in advance
  23. So I've created an entity that shoots projectiles, and everything works as intended, the problem is since my entity shoots really fast (Machinegun) obviously whoever is getting hit by the projectiles will constantly get knockback. Is there a way to decrease or completely remove knockback when the projectile entity hits another entity? Thank you in advance ๐Ÿ˜
  24. As the title says, basically 0 fall damage like a cat, is there a specific method I need to call? thanks in advance
×
×
  • Create New...

Important Information

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