1.16.5 CraftTweaker: No such member: getEntity
JL2210 opened this issue ยท 3 comments
I recently updated the mod from 1.3.8 to 2.0.1 and a CraftTweaker script I was using broke. I replaced mob_data
with entity_data
, but I'm still getting errors from CraftTweaker.
This is from a modpack called (Not Too Complicated 2)[https://github.com/MechOrigin/NTC2] in case you need to test. Though I could probably come up with a script that breaks using only vanilla items if that were easier.
Apologies if this is really obvious, I'm a novice in the area.
Relevant section of the log:
excerpt:
[01:17:23] [Render thread/INFO] [minecraft/NewChatGui]: [CHAT] [ERROR] CagedMobs.zs:34:14 CagedMobs.zs:34:14: No such member: getEntity
[01:17:23] [Render thread/INFO] [minecraft/NewChatGui]: [CHAT] [ERROR] CagedMobs.zs:35:4 CagedMobs.zs:35:4: No such symbol: cow
The edited script:
excerpt:
import mods.cagedmobs.EntitiesManager;
// ...
val entities = <recipetype:cagedmobs:entity_data>;
val cow = entities.getEntity( "cagedmobs:mobs/cow");
cow.addLoot(<item:miniutilities:experience_pearl>, 0.2, 1, 3);
cow.addLoot(<item:mysticalagriculture:inferium_essence>, 0.25, 1, 3);
I looked through the commit history and I can't see anything that would directly affect the getEntity function. I'm not sure what would cause this.
Unrelated but all of my empty cages and higher tier syringes were deleted from my inventory despite your changelog:
thus possibly all cages already placed in the world will disappear.
To not lose items, before updating, remove all cages, their upgrades, and DNA samples.
I can track this down to the item IDs being changed mobcage
->mob_cage
etc. Not too much of a problem since I can enable cheats over LAN. But I figured I'd mention it.
Thank you for the issue report. Firstly, I made a mistake in the changelog. All cages and syringes will unfortunately disappear, even if they would be stored in chests. What I really meant with what was written in the changelog, is that players should take out the environment blocks to not lose them.
Regarding the CT2 problem, it should be fixed in the newest update, it was a stupid mistake on my side. Please let me know if it works now :)
Just for you to know, there is a new version of the mod for MC 1.16.5, which backports the changes to Craft Tweaker support. Changes:
- Inside scripts, entity types are now specified as strings instead of bracket handlers (example: "minecraft:chicken" instead of <entitytype:minecraft:chicken>).