Skip to content

Instantly share code, notes, and snippets.

Avatar

ImIllusion IllusionTheDev

View GitHub Profile
View I'm a night 🦉
🌞 Morning 14 commits ██▏░░░░░░░░░░░░░░░░░░ 10.4%
🌆 Daytime 36 commits █████▌░░░░░░░░░░░░░░░ 26.7%
🌃 Evening 58 commits █████████░░░░░░░░░░░░ 43.0%
🌙 Night 27 commits ████▏░░░░░░░░░░░░░░░░ 20.0%
@IllusionTheDev
IllusionTheDev / KnockbackUtil.java
Last active Sep 27, 2021
Simulate realistic player knockback
View KnockbackUtil.java
// Ported from Exerosis' kotlin example
public class KnockbackUtil {
private static final double FRICTION = 1.0;
private static final double HORIZONTAL = 0.40;
private static final double VERTICAL = 0.36075;
private static final double EXTRA_VERTICAL = 0.1;
private static final double EXTRA_HORIZONTAL = 1.5;
public static Vector getKnockback(Location entityLoc, Entity attacker) {
@IllusionTheDev
IllusionTheDev / EasyMetadataPacket.java
Last active Aug 27, 2021
Test client-side entity
View EasyMetadataPacket.java
package me.illusion.test;
import com.comphenix.protocol.reflect.accessors.Accessors;
import com.comphenix.protocol.reflect.accessors.ConstructorAccessor;
import com.comphenix.protocol.utility.MinecraftReflection;
import com.comphenix.protocol.wrappers.WrappedBlockData;
import com.comphenix.protocol.wrappers.WrappedChatComponent;
import com.comphenix.protocol.wrappers.WrappedDataWatcher;
import com.comphenix.protocol.wrappers.WrappedWatchableObject;
import org.bukkit.inventory.ItemStack;
View ClientsideItem.java
public class ClientsideItem extends ClientsideEntity {
private final ClientsideHologram hitbox;
private final List<PacketContainer> packets = new ArrayList<>();
public ClientsideItem(Location location, ItemStack item) {
hitbox = new ClientsideHologram(location, "", true);
setup(item, location);
}