KubeJS (Old)

KubeJS (Old)

3M Downloads

Expected argument of type object, but instead had type object

sigmasoldi3r opened this issue ยท 0 comments

commented

Minecraft Version

1.19

KubeJS Version

1902.6.0-build.142

Rhino Version

1902.2.2-build.264

Architectury Version

6.5.69

Forge/Fabric Version

43.2.0

Describe your issue

Crash when trying to get the object's property names.

dev.latvian.mods.rhino.EcmaError: TypeError: Expected argument of type object, but instead had type object (startup_scripts:script.js#31)

Repro code:

StartupEvents.registry('item', event => {
	event.create('sample')
		.displayName('Sample')
		.texture('some:item/texture')
		.food(food => {
			food
				.alwaysEdible()
				.eaten(ctx => {
					console.log(Object.getOwnPropertyNames(ctx.player).join(', '))
				})
		});
})

Crash report/logs

No response