43 lines
2.2 KiB
Java
43 lines
2.2 KiB
Java
package net.mcreator.target.procedures;
|
|
|
|
import net.minecraft.world.item.ItemStack;
|
|
import net.minecraft.world.entity.Entity;
|
|
import net.minecraft.server.level.ServerLevel;
|
|
import net.minecraft.commands.CommandSourceStack;
|
|
import net.minecraft.commands.CommandSource;
|
|
|
|
public class ArDsProcedure {
|
|
public static void execute(Entity entity) {
|
|
if (entity == null)
|
|
return;
|
|
ItemStack usehand = ItemStack.EMPTY;
|
|
{
|
|
Entity _ent = entity;
|
|
if (!_ent.level().isClientSide() && _ent.getServer() != null) {
|
|
_ent.getServer().getCommands().performPrefixedCommand(new CommandSourceStack(CommandSource.NULL, _ent.position(), _ent.getRotationVector(), _ent.level() instanceof ServerLevel ? (ServerLevel) _ent.level() : null, 4,
|
|
_ent.getName().getString(), _ent.getDisplayName(), _ent.level().getServer(), _ent), "playsound target:m4far player @a ~ ~ ~ 12 1");
|
|
}
|
|
}
|
|
{
|
|
Entity _ent = entity;
|
|
if (!_ent.level().isClientSide() && _ent.getServer() != null) {
|
|
_ent.getServer().getCommands().performPrefixedCommand(new CommandSourceStack(CommandSource.NULL, _ent.position(), _ent.getRotationVector(), _ent.level() instanceof ServerLevel ? (ServerLevel) _ent.level() : null, 4,
|
|
_ent.getName().getString(), _ent.getDisplayName(), _ent.level().getServer(), _ent), "playsound target:m4veryfar player @a ~ ~ ~ 24 1");
|
|
}
|
|
}
|
|
{
|
|
Entity _ent = entity;
|
|
if (!_ent.level().isClientSide() && _ent.getServer() != null) {
|
|
_ent.getServer().getCommands().performPrefixedCommand(new CommandSourceStack(CommandSource.NULL, _ent.position(), _ent.getRotationVector(), _ent.level() instanceof ServerLevel ? (ServerLevel) _ent.level() : null, 4,
|
|
_ent.getName().getString(), _ent.getDisplayName(), _ent.level().getServer(), _ent), "stopsound @s player target:m4far");
|
|
}
|
|
}
|
|
{
|
|
Entity _ent = entity;
|
|
if (!_ent.level().isClientSide() && _ent.getServer() != null) {
|
|
_ent.getServer().getCommands().performPrefixedCommand(new CommandSourceStack(CommandSource.NULL, _ent.position(), _ent.getRotationVector(), _ent.level() instanceof ServerLevel ? (ServerLevel) _ent.level() : null, 4,
|
|
_ent.getName().getString(), _ent.getDisplayName(), _ent.level().getServer(), _ent), "stopsound @s player target:m4veryfar");
|
|
}
|
|
}
|
|
}
|
|
}
|