Feroov
Members-
Posts
80 -
Joined
-
Last visited
Everything posted by Feroov
-
Yes of course there was misunderstanding I explained it bad, I basically have a miner human mob the point was if player dropped him a material it would go find and mine that block
-
You mean like the goal of the entities are not supported? Do you have a suggestion where I should ask for help from then?
-
So I am currently making a mob where whenever it sees a specific type of block it goes on to "mine" it. I was thinking how can I create such functionality etc when zombies egg destroying AI came to my mind, I did implement it etc so it does work on my mob but the only issue I have is that my mob will mine the block only if it is out in the open, meaning all sides of the block (north,west,south,east) is touching air and above as well. I'm using coal ore for example, so say you're in the caves and you know how coal ore spawns, my mobs will obviously not mine it since not all sides are facing/touching air Where should I be mainly looking and playing around at, is it the isValidTarget method or the getPosWithBlock? any ideas etc thx in advance
-
[1.19.2] How to spawn particle inside releaseUsing
Feroov replied to Feroov's topic in Modder Support
It is what I actually needed THANK YOU :D, had to tweak some math arithmetics and all is good now, have a great rest of your day/night cheers -
[1.19.2] How to spawn particle inside releaseUsing
Feroov replied to Feroov's topic in Modder Support
Could you please guide/show me the way to do it, I'd really appreciate it, still trying to grasp the logic -
[1.19.2] How to spawn particle inside releaseUsing
Feroov replied to Feroov's topic in Modder Support
Yes I got it to work now with this: double x = playerentity.getX(); double y = playerentity.getY(); double z = playerentity.getZ(); if (level instanceof ServerLevel _level) { _level.sendParticles(ParticleTypes.FLAME, x, y + 1.5, z + 0.5, 1, 1, 0, 0, 0); _level.sendParticles(ParticleTypes.SMOKE, x, y + 1.5, z +0.5, 1, 1, 0, 0, 0); } The only issue is the particles spawn on the specific location/area, so if I shoot from X cordinate I see the particles if I turn around and shoot well they spawn behind me then, now heres my question, how can I make it so that the particles only spawn/appear in front of the player no matter what -
[1.19.2] How to spawn particle inside releaseUsing
Feroov replied to Feroov's topic in Modder Support
I'll send in the full class it might be more useful https://pastebin.com/RuREdFYj -
[1.19.2] How to spawn particle inside releaseUsing
Feroov replied to Feroov's topic in Modder Support
Am I calling it correctly inside the releaseUsing method? serverLevel.sendParticles(ParticleTypes.FLASH, x, y, z, 2, 0.2D, 0.2D, 0.2D, 0.0D); because now the gun wont shoot pretty much -
[1.19.2] How to spawn particle inside releaseUsing
Feroov replied to Feroov's topic in Modder Support
This is what I have so far @Override public void releaseUsing(ItemStack stack, Level level, LivingEntity livingEntity, int timeLeft) { if (livingEntity instanceof Player) { Player playerentity = (Player) livingEntity; if (stack.getDamageValue() < (stack.getMaxDamage() - 1)) { playerentity.getCooldowns().addCooldown(this, 4); if (!level.isClientSide) { NineMMBullet nineMMBullet = createArrow(level, stack, playerentity); nineMMBullet.shootFromRotation(playerentity, playerentity.getXRot(), playerentity.getYRot(), 0.0F, 3.0F, 2.0F); nineMMBullet.isNoGravity(); nineMMBullet.isNoPhysics(); stack.hurtAndBreak(1, livingEntity, p -> p.broadcastBreakEvent(livingEntity.getUsedItemHand())); level.addFreshEntity(nineMMBullet); level.playSound((Player) null, playerentity.getX(), playerentity.getY(), playerentity.getZ(), ModSoundEvents.PISTOL.get(), SoundSource.PLAYERS, 1.0F, 1.0F); if (!level.isClientSide) { final int id = GeckoLibUtil.guaranteeIDForStack(stack, (ServerLevel) level); final PacketDistributor.PacketTarget target = PacketDistributor.TRACKING_ENTITY_AND_SELF .with(() -> playerentity); GeckoLibNetwork.syncAnimation(target, this, id, STATE); } } } } } -
[1.19.2] How to spawn particle inside releaseUsing
Feroov replied to Feroov's topic in Modder Support
Well no where I assume, even though I tweak the numbers still nothing is present -
As the title says I got a custom ranged weapon, and I would like to spawn a particle once the item is been used lets say I tried using for(int i = 0; i < 2; ++i) { level.addParticle(ParticleTypes.FLASH, 0d, 0d, 0d, 0d, 0d, 0d); } No luck, any ideas?
-
Yes working perfectly thanks, I got confused with isPushable method but all good now
-
What method do I call so my entity is resistant to knockback from explosion?
-
True true was thinking the same, appreciate it man cheers
-
Would I call setBlockAndUpdate inside the tick method from Primed entity or should it be called from the tnt block class?
-
I apologize for explaining it badly, yes something like level.setblock so a good idea to understand would be imagine a normal hole in the overworld, say you use this custom tnt inside the hole, it will fill up the hole with dirt does that make sense? Here is a mod for reference though this is for fabric unfortunately obviously need for forge: https://www.curseforge.com/minecraft/mc-mods/dirtnt
-
So I got a perfectly working custom TNT, any ideas how I can on explode spawn blocks around the dead "primed tnt" entity?
-
As the title suggests how can we implement a sound event that plays once when the entity is spawned etc in a way boss music, thanks in advance
-
Hi so I have this code that works: public InteractionResult mobInteract(Player player, InteractionHand interactionHand) { this.playSound(ModSoundEvents.HUNTER_DEATH.get(), 1.0F, 1.0F); return super.mobInteract(player, interactionHand); } which plays the audio I want on right clicking the entity, the problem is it sometimes plays two or more different sounds at the same time. I have registered the "HUNTER_DEATH" as a single registry but the sounds.json contains or directs to multiple files as below: "hunter_death": {"category": "passive", "sounds": [{ "name": "frv:hunter_death"}, { "name": "frv:hunter_death2"}, { "name": "frv:hunter_death3"},{ "name": "frv:hunter_death4"}], "subtitle": "frv.hunter_death" }, How can I make it so that it plays one sound file instead of two or three simultaniously.
-
[1.19.1] Spawn structure where you spawn in the Dimension
Feroov replied to Feroov's topic in Modder Support
Yeah mine isn't too big, it's small (like a custom portal enterance some sorts), I'll take a look over this thank you I appreciate it ๐ -
Basically I have a custom dimension with a custom biome, I currently don't use a traditional portal but a normal block that is like a teleporter (teleports on right click) I wanted to know how can I make one of my structures spawn on the location where player spawns when I switch dimensions. Or to put in another words you know how in nether a portal spawns inside nether when you enter nether, that "portal" would be a custom structure instead. I hope I did explain it well. I apologize for confusion
-
Yes I know, but I still quite didn't understand since I am more of a visual learner, I can't think of it, if there is an example I'd really appreciate it
-
As the title suggests, is it possible to add my custom sound/soundevent to when switching between my custom dimension, so instead of playing the default vanilla sound when changing dim, it would be mine There is a method I found but its a boolean, not really sure how I can implement mine, the method is called playTeleportSound
-
[1.19.1] Entity spawn broken in custom dimensions biome
Feroov replied to Feroov's topic in Modder Support
Makes it even worse ๐ -
[1.19.1] Entity spawn broken in custom dimensions biome
Feroov replied to Feroov's topic in Modder Support
This is my biome json: https://pastebin.com/E0gije8T dimension: https://pastebin.com/6Gp9aj5G dimension_type: https://pastebin.com/kMKWLPsa