#How Can i Get the Entity Player who Placed the Falling Block Entity to make it an Achivement? X(

130 messages ยท Page 1 of 1 (latest)

weary geyser
#

im doing a mod where the sniffer egg is an anvil on placing on top of air and if it kills an entity and it hatch (has a 17% chance of hatch while falling) it will active a criteria that will give the player the achievemnt :

buoyant stag
#

:3

weary geyser
buoyant stag
#

(assuming you're on yarn)

#

!yc AbstractCriterion

halcyon copperBOT
#
1.21.11 matches

Names

Official: de
Intermediary: net/minecraft/class_4558
Yarn: net/minecraft/advancement/criterion/AbstractCriterion

Yarn Access Widener

accessible class net/minecraft/advancement/criterion/AbstractCriterion
Javadoc

buoyant stag
#

!ym AbstractCriterion

halcyon copperBOT
#

no matches for the given method name, MC version and query namespace

buoyant stag
#

Oh so the m and c is for method and class

#

But yah look at vanilla on how they trigger criterion

weary geyser
#

like an anvil?

#

no right? :/

buoyant stag
#

Why not

#

Well not in the order you thought it would be

weary geyser
#

abstract criterion? ๐Ÿค”

buoyant stag
#

So you have to first make the falling block know who placed it

weary geyser
#

we are talking about jsons right?

buoyant stag
weary geyser
#

*jsons

buoyant stag
#

Wait are you trying to do this with just datapack

#

Hmm

weary geyser
buoyant stag
#

It might be possible in theory

#

Kinda

weary geyser
#

but idk if its possible full json just the achievement part

buoyant stag
weary geyser
# buoyant stag Kinda

mmm then how, where in which part of the code can i refer the player who placed it ๐Ÿค”

buoyant stag
#

So like you make the falling block know the player that placed it

#

Then

weary geyser
#

yep

#

which part i should mix?

buoyant stag
#

When the falling block kill something

weary geyser
#

yeap

buoyant stag
#

Trigger the criterion

weary geyser
buoyant stag
#

Sorry internet ded

#

Sorry

#

Internet died

#

Still is dead

buoyant stag
weary geyser
#

F concern

weary geyser
#

LAD LAD LAD

weary geyser
#

im just searching when the player X places the block that is the local one (the block is this)

buoyant stag
#

oh is that 1.21

#

that looks different

weary geyser
#

can i reference in this advancement holder the advacement that i made on json?

weary geyser
buoyant stag
#

what version are you on?

weary geyser
#

so can i reference this just by the ID?

weary geyser
#

the best one

buoyant stag
#

one sec cause that doesn't look right

#

ah yeah they changed it

weary geyser
#

using this?

#

i mean i can reference the json achievement on this criteria code right?

#

soo i dont have to rewrite it

#

in the .build(identifier) method option ๐Ÿ˜›

buoyant stag
#

Im not sure if thats correct or not

#

probably not

weary geyser
weary geyser
#

you have more experience than me ๐Ÿ˜…

buoyant stag
#

wait so how are you summoning the falling block rn

#

do the summoned block have its own class

weary geyser
buoyant stag
#

hm?

weary geyser
buoyant stag
#

right

#

take a look at EntityHurtPlayerTrigger

weary geyser
#

but can i call

#

AHHHHHHH I HAVE IT

#

I HAVEEEEEEEEEEE ITTTTTTTTTT

#

criteria is for custom advancements that doesnt exists on the jsons

#

they are separated things :3

#

and for different uses

#

but the same result

buoyant stag
#

yeah

weary geyser
# buoyant stag yeah

now i just need to know which trigger to call the player who placed the same block

#

idk if possible

#

if it places it and the falling block damage an entity/kill

buoyant stag
#

thats why im telling you to make your own criterion

weary geyser
#

dw im going into that ๐Ÿ˜‰

buoyant stag
#

cause i don't think its possible to do that with vanilla criteria

weary geyser
#

im not already doing it?

#

AdvancementHolder rootAdvancement = Advancement.Builder.advancement().display(Items.SNIFFER_EGG, ).addCriterion("fall_on_entity_placed", Trigger)

#

i will call it on the code part that will execute it

buoyant stag
#

Thats not how advancement work

#

sadly

weary geyser
#

what ideas would give

#

*bad english btw

buoyant stag
#

what i said before

#

make your own advancement trigger

#

(criterion if you're on yarn)

weary geyser
buoyant stag
#

youre on mojmap tho

weary geyser
#

yep

buoyant stag
#

After you make your own version you have to register it

weary geyser
#

i mean im looking for the otherwise

buoyant stag
weary geyser
#

player hurt entity i think its

#

ahh thankyou

#

can you give me a hug of good luck? :3

buoyant stag
#

you can also look at the myrad different Trigger

#

its just the simpliest of them all

#

but the idea is

  1. Keep track of what player placed the block
  2. When the falling block kill a entity, trigger your custom criterion for the player who placed the block
#

also look at CriteriaTriggersto see how to register your trigger when you're done with making your own register

weary geyser
#

There isn't other simpler solution? No

#

I mean I have the player in on place of the mixin code of falling block

#

And I have when it impact on the sniffer egg one

#

AHHHHHH I HAVE AN IDEA

#

I think.... Idk

buoyant stag
weary geyser
#

I HAVE IT I HAVE IT I HAVE IT 100%

#

Wish me luck ๐Ÿ˜ญ ๐Ÿ™

#

Just using OnPlace method bc I have all the references ๐Ÿ˜‰