1 Commits

Author SHA1 Message Date
90cbd08265 Add Item Drop 2026-01-26 00:17:23 +01:00
4 changed files with 25 additions and 15 deletions

View File

@@ -19,6 +19,5 @@
"LoadBefore": {},
"DisabledByDefault": false,
"IncludesAssetPack": false,
"ServerVersion": "2026.02.19-1a311a592",
"SubPlugins": []
}

View File

@@ -1,3 +1,3 @@
#!/usr/bin/env bash
mvn package
mv ./target/EndermanPlugin-0.1.0.jar /home/tikaiz/.local/share/Hytale/UserData/Mods/
mv ./target/EndermanPlugin-0.1.0.jar /home/tikaiz/.var/app/com.hypixel.HytaleLauncher/data/Hytale/UserData/Mods/

View File

@@ -1,14 +1,18 @@
package com.greiflo;
import com.hypixel.hytale.component.ArchetypeChunk;
import com.hypixel.hytale.component.CommandBuffer;
import com.hypixel.hytale.component.ComponentType;
import com.hypixel.hytale.component.Store;
import com.hypixel.hytale.component.*;
import com.hypixel.hytale.component.query.Query;
import com.hypixel.hytale.component.system.EntityEventSystem;
import com.hypixel.hytale.logger.HytaleLogger;
import com.hypixel.hytale.math.vector.Vector3d;
import com.hypixel.hytale.math.vector.Vector3f;
import com.hypixel.hytale.server.core.inventory.ItemStack;
import com.hypixel.hytale.server.core.modules.entity.component.DisplayNameComponent;
import com.hypixel.hytale.server.core.modules.entity.component.PositionDataComponent;
import com.hypixel.hytale.server.core.modules.entity.component.TransformComponent;
import com.hypixel.hytale.server.core.modules.entity.damage.Damage;
import com.hypixel.hytale.server.core.modules.entity.item.ItemComponent;
import com.hypixel.hytale.server.core.modules.entity.item.PickupItemComponent;
import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
import org.checkerframework.checker.nullness.compatqual.NonNullDecl;
import org.checkerframework.checker.nullness.compatqual.NullableDecl;
@@ -27,8 +31,14 @@ public class EndermanDamageHandler extends EntityEventSystem<EntityStore, Damage
@Override
public void handle(int i, @NonNullDecl ArchetypeChunk<EntityStore> archetypeChunk, @NonNullDecl Store<EntityStore> store, @NonNullDecl CommandBuffer<EntityStore> commandBuffer, @NonNullDecl Damage damage) {
var ref = archetypeChunk.getReferenceTo(i);
TransformComponent transformComponent = store.getComponent(ref, TransformComponent.getComponentType());
var itemstack = new ItemStack("Rock_Stone", 64, null);
Holder<EntityStore> drops = ItemComponent.generateItemDrop(store, itemstack, transformComponent.getPosition().clone(), Vector3f.ZERO,0,0,0);
commandBuffer.addEntity(drops, AddReason.SPAWN);
EndermanComponent endermanTeleportComponent = store.getComponent(ref, endermanComponentType);
var entityName = store.getComponent(ref, DisplayNameComponent.getComponentType());

View File

@@ -5,17 +5,18 @@
"Description": "Enderman Plugin",
"Authors": [
{
"Name": "It's you!"
"Name": "greiflo",
"Email": "grflo7228@gmail.com"
},
{
"Name": "tikaiz",
"Email": "tikaiz@gmx.at"
}
],
"Website": "",
"ServerVersion": "2026.02.19-1a311a592",
"Dependencies": {
},
"OptionalDependencies": {
},
"ServerVersion": "*",
"Dependencies": {},
"OptionalDependencies": {},
"DisabledByDefault": false,
"IncludesAssetPack": false,
"Main": "com.greiflo.EndermanPlugin"