How can I make the player invisible without using vanilla's Invisibility potion effect

Started by NeonCreeper4003 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Aug 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How can I make the player invisible without using vanilla's Invisibility potion effect

I'm attempting to make a potion effect that works like Shadow Form from Minecraft Dungeons; it should make the player invisible, increase their attack damage, and be removed once the player attacks an entity.

I already know how to make the effect increase the player's damage and how to remove it when they attack something, but I don't know how to make them invisible while affected by it. I do not want to utilize vanilla Minecraft's Invisibility status effect as Shadow Form should also hide the player's armor and be able to co-exist with Invisibility without affecting it.

While it'd be preferable if I could do this in procedures, I have a strong feeling that I will need to write custom code for this.

 

Versions are MCreator 2025.2, Minecraft 1.21.1, NeoForge 21.1.176

RedWire's Plugin is present if that could potentially be useful here.

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
This custom code snippet…
Sat, 08/30/2025 - 16:34

This custom code snippet will hide the Event/target entity for all other players

MinecraftServer server = entity.getServer();
		assert server != null;
		List<ServerPlayer> players = server.getPlayerList().getPlayers();
		ClientboundRemoveEntitiesPacket packet = new ClientboundRemoveEntitiesPacket(entity.getId());
		for(ServerPlayer player: players) {
			if(player == entity) continue;
			player.connection.send(packet);
		}
Joined Aug 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@friyes Where would I insert…
Sat, 08/30/2025 - 18:56

@friyes Where would I insert this code snippet? I haven't done anything with custom code in MCreator before so I don't actually know where to place this.

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Just in a custom code…
Sat, 08/30/2025 - 18:58

Just in a custom code snippet block

Joined Aug 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@friyes What trigger would I…
Sat, 08/30/2025 - 19:01

@friyes What trigger would I connect this to? As in like either a global trigger or one of the various triggers for the status effect (such as On effect active tick)

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Any trigger that provides an…
Sat, 08/30/2025 - 19:04

Any trigger that provides an event/target entity block

 

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
should work   but i'm not…
Sat, 08/30/2025 - 19:05

should work

 

but i'm not sure about performance if used in tick events

Joined Aug 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@friyes Thank you for your…
Sat, 08/30/2025 - 19:06

@friyes Thank you for your help!

Joined Aug 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@friyes Upon attempting a…
Sat, 08/30/2025 - 19:13

@friyes Upon attempting a test run the build failed to compile and it's saying "error: cannot find symbol" and pointing to the word "entity"

Joined Aug 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Procedure content (runs on…
Sat, 08/30/2025 - 19:14

Procedure content (runs on effect being applied):

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
oh yeah sorry, you have to…
Sat, 08/30/2025 - 19:16

oh yeah sorry, you have to do this, if you don't use the entity block anywhere else in the procedure,

where /*code*/ is still that big snippet I originally sent

 

Joined Aug 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@friyes Would my client be…
Sat, 08/30/2025 - 19:20

@friyes Would my client be able to see that I'm invisible from the effect or does it only make me invisible for other players?

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
the target entity wouldn't…
Sat, 08/30/2025 - 19:22

the target entity wouldn't be able to see it no, it technically just makes the server tell all other clients the target entity doesn't exist

Joined Aug 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@friyes Oh well I don't know…
Sat, 08/30/2025 - 19:26

@friyes Oh well I don't know if that method would work particularly well but thanks for your help!