From 2c8bb5b6e0f4a3756d5e10034c7ca9bcfa71ecfb Mon Sep 17 00:00:00 2001 From: ZXMushroom63 Date: Mon, 20 Jan 2025 21:18:50 +0800 Subject: [PATCH] entity keygen function --- postinit.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/postinit.js b/postinit.js index 344d338..b586040 100644 --- a/postinit.js +++ b/postinit.js @@ -1055,4 +1055,8 @@ globalThis.modapi_postinit = "(" + (() => { var values = [...ModAPI.reflect.getClassById("net.minecraft.block.Block").staticVariables.blockRegistry.$modapi_specmap.values()]; return qhash(block, values); } + ModAPI.keygen.entity = function (entity) { + var values = ModAPI.reflect.getClassById("net.minecraft.entity.EntityList").staticVariables.idToClassMapping.$elementData.data.filter(x=>x).map(x=>x.$key.$value); + return qhash(entity, values); + } }).toString() + ")();";