#(mrcrash) return location near player location

61 messages · Page 1 of 1 (latest)

hybrid horizon
#

Hi !

I try to return to the location of the item frame when i place the oak_log (the item frame is just here to give you a exemple)

solar jungleBOT
#

(mrcrash) return location near player location

solar jungleBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.

hybrid horizon
#

Basically, i want to display a display_entity like inside a item frame but without item frame, to make a modded drawer look

mossy rapids
#

what

#

you mean like, to the side of the block?

hybrid horizon
#

yeah

#

i probably need to spawn it inside the block and .add to make it go littlely out the block

#

But idk how to ".add[1 on the side of the player loca]"

#

Sorry if i explain bad

fierce roost
#

you can make item frames invsible if that works for your situation

hybrid horizon
#

Nope because if i use item frame i can't place another block near to the first one

fierce roost
#

i see

#

so you want to try and find the location of the middle of the block?

hybrid horizon
#

Hm, not really, i need to starting from a locatioon (the block center), and adding some values ​​to it to go to the player

fierce roost
#

so basically, where an item would end up on an item frame, without the item frame attached?

hybrid horizon
#

exactly

fierce roost
#

!e places block

warped mantleBOT
# fierce roost !e places block
Group

Player

Event Lines

player places block player places <item>

Switches

using:<hand_type> to only process the event if the player is using the specified hand type (HAND or OFF_HAND).
against:<location> to only process the event if block that this new block is being placed against matches the specified LocationTag matcher.
type:<material> to only process the event if the block placed matches the MaterialTag matcher input.

Triggers

when a player places a block.

Has Player

Always. - this adds switches flagged:<flag name> + permission:<node>, in addition to the <player> link.

Context

<context.location> returns the LocationTag of the block that was placed.
<context.material> returns the MaterialTag of the block that was placed.
<context.old_material> returns the MaterialTag of the block that was replaced.
<context.item_in_hand> returns the ItemTag of the item in hand.
<context.hand> returns the name of the hand that the block was in (HAND or OFF_HAND).
<context.against> returns the LocationTag of the block this block was placed against.

Has Known Location

True - this adds switches in:<area> + location_flagged:<flag name>.

Cancellable

True - this adds <context.cancelled> and determines cancelled + cancelled:false.

Examples
on player places block:
after player places torch using:off_hand:
on player places cactus against:sand:
# This example process the event only if the player places any block that isn't tnt.
on player places block type:!tnt:
- announce "<player.name> has placed a block that isn't TNT. Lucky!"
fierce roost
#

should be able to use <context.against>

#

not sure if that gives a precise location but it seems to just give the block

hybrid horizon
#

Hm, I don't understand how this can help me, if I understand the meta correctly it will return to the block below my location if I put it on the ground?

fierce roost
#

do you want this custom block to be placable on any tile?

#

well

#

like any direction?

hybrid horizon
#

Hm

#

The direction facing the player

fierce roost
#

gotchas

mossy rapids
#

<player.cursor_on_solid.add[<player.eye_location.ray_trace[return=normal]>]>

hybrid horizon
#

What's mean return=normal ?

mossy rapids
#

!t ray_trace

warped mantleBOT
# mossy rapids !t ray_trace
Cannot Specify Searched Tag

Multiple possible tags: <LocationTag.ray_trace[(range=<#.#>/{200});(return=<{precise}/block/normal>);(default=<{null}/air>);(fluids=<true/{false}>);(nonsolids=<true/{false}>);(entities=<matcher>);(ignore=<entity>|...);(raysize=<#.#>/{0})]>, <LocationTag.ray_trace_target[(range=<#.#>/{200});(blocks=<{true}/false>);(fluids=<true/{false}>);(nonsolids=<true/{false}>);(entities=<matcher>);(ignore=<entity>|...);(raysize=<#.#>/{0})]>.

mossy rapids
#

jeeez

#

"normal" to return the normal vector of the impact location

fierce roost
#

basically returns a flat, non angled direction

hybrid horizon
#

Oh okay

fierce roost
#

this angle is perpendicular to the surface it hits

hybrid horizon
#

Look like rlly usefull

fierce roost
#

definitely has its use cases

#

i use it in my bounce ball script in order for the ball to stay out of the wall

hybrid horizon
#

I eat, try and if it's okay resolve 🫡

pure bluffBOT
hybrid horizon
#

Okayyy

#

work pretty well

#

just can i slightly adjust the position of the item? like moving back/forward a little in/out of the block ?

fierce roost
#

yes

hybrid horizon
#

How? like how can i get back frowad relative to the player location

#

sorr i'm bas with raytrace

fierce roost
#

you can use that normal as a vector as well

hybrid horizon
#

as vector??

#

like

#

<player.cursor_on_solid.add[<player.eye_location.ray_trace[return=normal].add[something]>]>

#

no

mossy rapids
#
    - define vector <player.eye_location.ray_trace[return=normal].mul[0.5]>
    - define loc <context.location.center.add[<[vector]>]>
    - fakespawn item_display[item=carrot] <[loc]> d:5s```
hybrid horizon
#

Nice !

#

now, step 2

#

can i do that to all direction excluding up/down ?

#

i mean, this one is perfect for what i want to do, but 4 faces display item can be usefull for a second drawer type

hybrid horizon
#

founded !