Skip to content

Instantly share code, notes, and snippets.

@aadnk
aadnk / LightSource.java
Last active June 28, 2021 14:15
LightSource - send a single Packet51MapChunk
package com.comphenix.example;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.List;
import net.minecraft.server.v1_5_R3.Entity;
import net.minecraft.server.v1_5_R3.EntityHuman;
import net.minecraft.server.v1_5_R3.EnumSkyBlock;
import net.minecraft.server.v1_5_R3.IWorldAccess;
@aadnk
aadnk / LightSourceEx.java
Created June 22, 2013 18:17
LightSource Advanced - Update nearby chunks as well, but only if necessary.
package com.comphenix.example;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.List;
import net.minecraft.server.v1_5_R3.Entity;
import net.minecraft.server.v1_5_R3.EntityHuman;
import net.minecraft.server.v1_5_R3.EnumSkyBlock;
import net.minecraft.server.v1_5_R3.IWorldAccess;
@aadnk
aadnk / EntityHider.java
Last active April 14, 2025 06:07
Hide or show entities
package com.comphenix.example;
import static com.comphenix.protocol.PacketType.Play.Server.*;
import java.lang.reflect.InvocationTargetException;
import java.util.Arrays;
import java.util.Map;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
@aadnk
aadnk / Attributes.java
Last active September 15, 2020 10:13
Edit attributes in 1.6.2 (Not dependent on ProtocolLib). See https://github.com/aadnk/AttributeStorage/tree/nms for 1.7.2.
package com.comphenix.example;
import java.lang.reflect.Field;
import java.util.Iterator;
import java.util.List;
import java.util.UUID;
import java.util.concurrent.ConcurrentMap;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@aadnk
aadnk / Attributes-NOVER.java
Created July 7, 2013 16:17
Edit attributes in 1.6.1 and above (Dependent on ProtocolLib)
package com.comphenix.example.nover;
import java.util.Iterator;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ConcurrentMap;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@aadnk
aadnk / NoParticleExplosion.java
Created July 12, 2013 18:22
Create an explosion with no particles.
package com.comphenix.example;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import com.comphenix.protocol.Packets;
@aadnk
aadnk / AttributesExample.java
Created July 17, 2013 23:47
Make attributes work in creative mode.
package com.comphenix.example;
import java.io.DataInputStream;
import java.io.IOException;
import java.util.List;
import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@aadnk
aadnk / SilentWalkers.java
Created July 19, 2013 22:12
Silence a player's walking.
package com.comphenix.example;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import com.comphenix.protocol.Packets;
import com.comphenix.protocol.ProtocolLibrary;
import com.comphenix.protocol.events.ConnectionSide;
@aadnk
aadnk / NoEnderDragonSound.java
Created July 24, 2013 03:25
No ender dragon sound in different worlds.
package com.comphenix.example;
import org.bukkit.plugin.java.JavaPlugin;
import com.comphenix.protocol.Packets;
import com.comphenix.protocol.ProtocolLibrary;
import com.comphenix.protocol.events.ConnectionSide;
import com.comphenix.protocol.events.PacketAdapter;
import com.comphenix.protocol.events.PacketEvent;
@aadnk
aadnk / pom.xml
Created July 27, 2013 15:15
The Maven POM file used to compile MCore without changing its folder structure or updating the version.
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.massivecraft.mcore</groupId>
<artifactId>MCore</artifactId>
<version>${yaml.plugin.version}</version>
<name>${yaml.plugin.name}</name>
<packaging>jar</packaging>
<description>
MCore stands for MassiveCraft Core and is a plugin that contains libraries and features that other plugins make use of.
Cayorion from the Minecraft Server MassiveCraft is the lead programmer.