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 :
#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)
You'll want to make your own criterion and trigger it
:3
And how then >.<
Ehh, my example is in kotlin so tht won't help, search for AbstractCriterion in your ide
(assuming you're on yarn)
!yc AbstractCriterion
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
Page 1/1 - query ns: official,intermediary,yarn
!ym AbstractCriterion
no matches for the given method name, MC version and query namespace
Oh so the m and c is for method and class
But yah look at vanilla on how they trigger criterion
yeahhh but can i get the player owner who placed the block and detect if that block killed an entity?
like an anvil?
no right? :/
Yeah
Why not
Well not in the order you thought it would be
abstract criterion? ๐ค
So you have to first make the falling block know who placed it
we are talking about jsons right?
What's ksons?
yeppp ๐โโ๏ธ
*jsons
no, mod
but idk if its possible full json just the achievement part
Oh that's a tad bit easier if you can just make your own criterion
mmm then how, where in which part of the code can i refer the player who placed it ๐ค
When the falling block kill something
yeap
Trigger the criterion
yeahhh but like how, i cannot find tutorials X(
Sadly you'll just have to look at vanilla code
F 
LAD LAD LAD
I ALMOST HAVE IT ๐
im just searching when the player X places the block that is the local one (the block is this)
can i reference in this advancement holder the advacement that i made on json?
i have this
what version are you on?
so can i reference this just by the ID?
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 ๐
can you ask other online people to help and let know? :'/
wait so how are you summoning the falling block rn
do the summoned block have its own class
its on the local mixin code :/
hm?
its on the mixin class of falling block entity, just that
yep
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
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
thats why im telling you to make your own criterion
dw im going into that ๐
cause i don't think its possible to do that with vanilla criteria
wait
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
what i said before
make your own advancement trigger
(criterion if you're on yarn)
my own Trigger Instance
youre on mojmap tho
yep
look at EntityHurtPlayerTrigger
After you make your own version you have to register it
entity hurt player?
i mean im looking for the otherwise
use it as a guide on how to do your own
player hurt entity i think its
ahh thankyou
can you give me a hug of good luck? :3
you can also look at the myrad different Trigger
its just the simpliest of them all
but the idea is
- Keep track of what player placed the block
- 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
AHH right right
thank you
Sooo it's mandatory doing a trigger criteria custom
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
