#Check if a block can suffocate an entity

1 messages · Page 1 of 1 (latest)

onyx belfry
#

So far what I have figure is:

  • If the eye location is inside the block's bounding box and
  • The block is occluding

The block must suffocate, but for blocks like glass this doesn't seem to hold up because it is occluding, but doesn't suffocate

#

Any ideas on how I could go about improving this without manually checking?

analog wedge
#

i mean you could mixin/asm into the block and modify it is behavior :p

onyx belfry
#

That's not an option on Spigot sadly

analog wedge
#

actually it is an option

onyx belfry
#

I mean yes it is an option

analog wedge
#

if you add mixins into your project it should work

onyx belfry
#

Well no actually

#

You need something to actually inject the mixins

vital shale
#

^^ You need something like Ignite to bootstrap Mixins

#

Not all users can or are willing to install it

onyx belfry
#

It's for work stuff so we can actually do that

analog wedge
vital shale
onyx belfry
#

^

analog wedge
#

what about just ASM

onyx belfry
#

I again could

#

but I don't want to change vanilla behavior

analog wedge
#

i saw many plugins just using patches

vital shale
onyx belfry
#

I just need to check if suffocation can happen

onyx belfry
#

The JVM has full support for hotswapping method bodies

#

at any stage

analog wedge
#

you have two choices lol

vital shale
#

Hotswapping support varies from JVM to JVM

onyx belfry
#

I mean yeah fair point

vital shale
#

So what's the goal?

onyx belfry
onyx belfry
analog wedge
#

or is there block collision event in spigot

vital shale
#

If you want to detect suffocation damage you can just use a listener

onyx belfry
#

Yeah but the problem is I need to first check if I can spawn something at XYZ

#

and if it would suffocate there based on it's bounding box

vital shale
#

How would hotswapping a method body help there?

onyx belfry
#

Talking to @analog wedge about how you can still edit it

#

I wouldn't edit a method body lol

vital shale
#

If it's for work the just use ignite

#

should give you the tools you need

onyx belfry
#

we have an internal version of the fabric loader instead

vital shale
onyx belfry
#

but I could

analog wedge
#

you could always use fabric duke

onyx belfry
#

We modded fabric

#

lmao

#

Anyways I don't want to change the glass block's behavior

#

It is not what I need

#

I just need to check if at XYZ an entity can suffocate

#

I could spawn an entity and not send it to players to check, but like that's no-no performance

analog wedge
#

wouldnt it be a method inside block call in Minecraft?

#

look into how game implements suffocate

vital shale
#

There is probably a method you can call

#

Yeah

analog wedge
#

yeah

vital shale
#

Ignite provides access widerners if required

onyx belfry
#

We already checked Ignite

vital shale
#

then just use that

onyx belfry
#

Only if I can't do it in Spigot

#

if I can there's no need to use mods

vital shale
#

Take a look at how Minecraft checks suffocation

onyx belfry
#

doing that