This commit is contained in:
Piecuuu 2026-02-21 20:55:50 +01:00
commit 849cb399a6
5 changed files with 93 additions and 0 deletions

4
.gitignore vendored Normal file
View file

@ -0,0 +1,4 @@
build/
bin/
.gradle/
.vscode/

7
LICENSE Normal file
View file

@ -0,0 +1,7 @@
Copyright 2026 Piecuu
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

37
build.gradle Normal file
View file

@ -0,0 +1,37 @@
plugins {
id 'java'
id 'maven-publish'
}
group = 'pl.piecuu.invisninja'
version = '1.0'
java {
toolchain.languageVersion = JavaLanguageVersion.of(21)
withSourcesJar()
}
repositories {
mavenCentral()
mavenLocal()
maven {
url = 'https://repo.extendedclip.com/releases/'
}
}
dependencies {
compileOnly "pl.piecuu.jajoptak:leaf-api:1.21.11-R0.1-SNAPSHOT"
compileOnly "me.clip:placeholderapi:2.11.7"
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
}

View file

@ -0,0 +1,40 @@
package pl.piecuu.invisninja;
import org.bukkit.Bukkit;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.potion.PotionEffectType;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.TextReplacementConfig;
import net.kyori.adventure.text.format.TextDecoration;
public class InvisNinja extends JavaPlugin implements Listener {
@Override
public void onEnable() {
Bukkit.getPluginManager().registerEvents(this, this);
}
@EventHandler
public void onPlayerDeath(PlayerDeathEvent e) {
Entity en = e.getDamageSource().getCausingEntity();
if(!(en instanceof Player p)) return;
if(!isPlayerInvisible(p)) return;
Component newMessage = e.deathMessage()
.replaceText(TextReplacementConfig.builder()
.match(p.getName())
.replacement(Component.text("aaaaaaaaaaaaa").decoration(TextDecoration.OBFUSCATED, true))
.build()
);
e.deathMessage(newMessage);
}
public static boolean isPlayerInvisible(Player p) {
return p.hasPotionEffect(PotionEffectType.INVISIBILITY);
}
}

View file

@ -0,0 +1,5 @@
name: invisninja
version: 1.0
author: Piecuu
main: pl.piecuu.invisninja.InvisNinja
api-version: '1.21.11'