#CuriosAPI

42 messages · Page 1 of 1 (latest)

native pivot
#

I have this script but it gives me error that says Can't find method top.theillusivec4.curios.common.CuriosHelper.getEquippedCurios(dev.latvian.mods.kubejs.player.ServerPlayerJS) in the logs

dense hingeBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

native pivot
#

ProbeJS lying to me 😠

vale onyx
#

you have to convert player to mcplayer

native pivot
#

ah i got it

vale onyx
#

getEquippedCurios(player.minecraftPlayer) or whatever it is

native pivot
#

i was literally thinking of that xd

#

what is the difference between mcplayer and player

vale onyx
#

easier to not have to think about with 1.19 since you're playing with minecraft classes not kjs classes

native pivot
#

except fake players

#

i am on 1.18.2 sadge

vale onyx
#

in 1.18 everything is wrapped by kubejs, it's not the actual minecraft version of the thing

#

you can see it from your error that it can't find the method for dev.latvian.mods.kubejs.player.ServerPlayerJS which is the kubejs wrapped player

native pivot
#

now i have different error lol

#

oh it was mb

vale onyx
native pivot
#

[20:43:00] [ERR ] Error occurred while handling event 'player.tick': The choice of Java method top.theillusivec4.curios.common.CuriosHelper.findCurios matching JavaScript argument types (net.minecraft.server.level.ServerPlayer,net.minecraft.network.chat.TranslatableComponent) is ambiguous; candidate methods are: interface java.util.List findCurios(net.minecraft.world.entity.LivingEntity,net.minecraft.world.item.Item) interface java.util.List findCurios(net.minecraft.world.entity.LivingEntity,java.lang.String[]) (server_scripts:curios.js#13)

my log filled with this

#

[20:43:47] [ERR ] Error occurred while handling event 'player.tick': The choice of Java method top.theillusivec4.curios.common.CuriosHelper.findCurios matching JavaScript argument types (net.minecraft.server.level.ServerPlayer,dev.latvian.mods.kubejs.item.ItemStackJS) is ambiguous; candidate methods are: interface java.util.List findCurios(net.minecraft.world.entity.LivingEntity,net.minecraft.world.item.Item) interface java.util.List findCurios(net.minecraft.world.entity.LivingEntity,java.lang.String[]) (server_scripts:curios.js#13)

#

this is the correct error

#

dev.latvian.mods.kubejs.item.ItemStackJS is not equal to net.minecraft.world.item.Item Hmmge

vale onyx
#

item.item same idea as player

native pivot
#

How do i create that 😄 :DDD

#

do i need to import a minecraft api or smth

vale onyx
#

either pass in Item.of('magicfeather:magicfeather').item or do findCurios(player, item.item)

native pivot
#

[21:00:12] [ERR ] Error occurred while handling event 'player.tick': The choice of Java method top.theillusivec4.curios.common.CuriosHelper.findCurios matching JavaScript argument types (net.minecraft.server.level.ServerPlayer,string) is ambiguous; candidate methods are: interface java.util.List findCurios(net.minecraft.world.entity.LivingEntity,net.minecraft.world.item.Item) interface java.util.List findCurios(net.minecraft.world.entity.LivingEntity,java.lang.String[]) (server_scripts:curios.js#13)

#

it wants an array

#

😩

#

i changed it from findCurios() to findCurio()

#

[21:05:30] [ERR ] Error occurred while handling event 'player.tick': The choice of Java method top.theillusivec4.curios.common.CuriosHelper.findCurios matching JavaScript argument types (net.minecraft.server.level.ServerPlayer,be.ephys.magicfeather.ItemMagicFeather) is ambiguous; candidate methods are: interface java.util.List findCurios(net.minecraft.world.entity.LivingEntity,net.minecraft.world.item.Item) interface java.util.List findCurios(net.minecraft.world.entity.LivingEntity,java.lang.String[]) (server_scripts:curios.js#14) now it gives me this

vale onyx
#

thought you said you swapped to findCurio

native pivot
#

[21:07:31] [ERR ] Error occurred while handling event 'player.tick': Can't find method top.theillusivec4.curios.common.CuriosHelper.findCurio(net.minecraft.server.level.ServerPlayer,be.ephys.magicfeather.ItemMagicFeather). (server_scripts:curios.js#14)

vale onyx
#

try this....

onEvent('player.tick', event => {
  let player = event.minecraftPlayer
  if (curiosSearcher(player, Item.of('magicfeather:magicfeather'))) {
    player.setCustomName('Magic Feather')
  }
}
function curiosSearcher(player, item) {
  let curios = $CuriosAPI.getCuriosHelper().findCurios(player, (itemstack) => item.test(itemstack))
  console.log(curios)
  return true
}
native pivot
#

now i am reloading this

native pivot
# vale onyx try this.... ```js onEvent('player.tick', event => { let player = event.minecr...

Error occurred while handling event 'player.tick': The choice of Java method top.theillusivec4.curios.common.CuriosHelper.findCurios matching JavaScript argument types (net.minecraft.server.level.ServerPlayer,function) is ambiguous; candidate methods are: interface java.util.List findCurios(net.minecraft.world.entity.LivingEntity,net.minecraft.world.item.Item) interface java.util.List findCurios(net.minecraft.world.entity.LivingEntity,java.lang.String[]) (server_scripts:curios.js#14)

#

let item = Item.of('magicfeather:magicfeather').item.asItem() maybe adding .asItem() does something

vale onyx
#

grrrr, okay we'll do the signature method
neeeext
try this....

onEvent('player.tick', event => {
  let player = event.minecraftPlayer
  if (curiosSearcher(player, Item.of('magicfeather:magicfeather'))) {
    player.setCustomName('Magic Feather')
  }
}
function curiosSearcher(player, item) {
  let curios = $CuriosAPI.getCuriosHelper()['findCurios(net.minecraft.world.entity.LivingEntity,net.minecraft.world.item.Item)'](player, item.item)
  console.log(curios)
  return true
}
tulip helm
#

I have an exemple using player nbt, but I assume you want to use Java classes right?

native pivot
dense hingeBOT
#

@native pivot Unresolved thread still hasn't been closed! If your question was answered, please close this post with </ticket close:1054771505520717835> command!

native pivot
#

kek