Started by
Ima-builder
on
Topic category: Help with Minecraft modding (Java Edition)
Hi, I am trying to make a super invisibility potion (with a stack size of 16) , where even the potion disappears, I thought about swiping out the potion with a dummy invisible item but I'm not quite Shure how to do that (preferably with block coding).
Do you know how to code? If so, I can help you, it is not to hard.
If I have a reference chart I can do basic stuff.
Okay, well, this is an example of how I completely cancel the rendering of the player. Now, you can change the NBT, or however, you are checking for "complete invisibility".
what would I have to change if I want to slap this in the middle of a procedure?
You would place it, not in the procedure! But inside of the class. Perhaps you should post code.
package net.mcreator.smokebombs.procedures;
import net.minecraft.world.server.ServerWorld;
import net.minecraft.world.World;
import net.minecraft.potion.Effects;
import net.minecraft.potion.EffectInstance;
import net.minecraft.particles.ParticleTypes;
import net.minecraft.item.ItemStack;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.Entity;
import net.mcreator.smokebombs.SmokeBombsModElements;
@SmokeBombsModElements.ModElement.Tag
public class SplashSmokeBombPotionStartedappliedProcedure extends SmokeBombsModElements.ModElement {
public SplashSmokeBombPotionStartedappliedProcedure(SmokeBombsModElements instance) {
super(instance, 2);
}
public static void executeProcedure(java.util.HashMap<String, Object> dependencies) {
if (dependencies.get("entity") == null) {
System.err.println("Failed to load dependency entity for procedure SplashSmokeBombPotionStartedapplied!");
return;
}
if (dependencies.get("itemstack") == null) {
System.err.println("Failed to load dependency itemstack for procedure SplashSmokeBombPotionStartedapplied!");
return;
}
if (dependencies.get("world") == null) {
System.err.println("Failed to load dependency world for procedure SplashSmokeBombPotionStartedapplied!");
return;
}
Entity entity = (Entity) dependencies.get("entity");
ItemStack itemstack = (ItemStack) dependencies.get("itemstack");
World world = (World) dependencies.get("world");
double X = 0;
double Y = 0;
double Z = 0;
double Tic = 0;
double BombNum = 0;
((itemstack)).shrink((int) 1);
Tic = (double) 0;
X = (double) (entity.getPosX());
Y = (double) (entity.getPosY());
Z = (double) (entity.getPosZ());
while (((Tic) < 80)) {
Tic = (double) ((Tic) + 1);
if (world instanceof ServerWorld) {
((ServerWorld) world).spawnParticle(ParticleTypes.CLOUD, (X), (Y), (Z), (int) 500, 1, 1, 1, 0.01);
}
if (world instanceof ServerWorld) {
((ServerWorld) world).spawnParticle(ParticleTypes.CLOUD, (X), ((Y) + 1), (Z), (int) 500, 1, 1, 1, 0.01);
}
}
if (entity instanceof LivingEntity)
((LivingEntity) entity).addPotionEffect(new EffectInstance(Effects.SPEED, (int) 200, (int) 1, (false), (false)));
if (entity instanceof LivingEntity)
((LivingEntity) entity).addPotionEffect(new EffectInstance(Effects.INVISIBILITY, (int) 200, (int) 1, (false), (false)));
if (entity instanceof PlayerEntity)
((PlayerEntity) entity).getCooldownTracker().setCooldown(((itemstack)).getItem(), (int) 200);
}
}
Make sure you create the corresponding NBT or condition. Otherwise it won't work!
Sorry for being such a noob but, what would creating the corresponding NBT or condition entail?
Okay, so you see the check;
in;
If you get rid of that check, the player will always be invisible. So we need to check if the player is supposed to be invisible (NBT works fine).
So when you want your entity to be invisible use the line;
And the opposite;
Now there are issues (sided) that may come up. Just don't worry about that for now.
It gave me this error.
I can't see it
the link? or can't see it on discord?
I can't see it on discord, can you use imgur? Or just post the console
https://imgur.com/y6QLgxm