#help-development

1 messages · Page 963 of 1

young knoll
#

I mean idk much about the security of having a socket open

buoyant jasper
#

hi

young knoll
#

Yo

buoyant jasper
#

How do i make hexadecimal color code

    ItemMeta kit3meta = kit3.getItemMeta();
    kit3meta.setDisplayName(ChatColor.DARK_RED + "" + ChatColor.BOLD + "Archer Kit");
#

instead of chatcolor

young knoll
#

ChatColor.of

#

Via the bungee ChatColor, not the Bukkit one

buoyant jasper
#

it doesnt let me

#

it shows value of

young knoll
#

Then you are using the Bukkit ChatColor

#

Switch your import

buoyant jasper
#

how to do that

urban kernel
#

How can I check if the args length is 1 OR 2?

rotund ravine
#

==

#

||

junior geyser
#

args.length == 1 || args.length ==2

urban kernel
#

args.length == 1 || args.length == 2

#

yeah cool

young knoll
urban kernel
#

thanks

#

thought it was

stiff sonnet
#

does Location.add modify the location itself?

young knoll
#

Yes

stiff sonnet
#

I'm gonna die now

#

I've been debugging this for multiple hours

stiff sonnet
# young knoll Yes

so how would you combine locations then without having to clone the base location every single time?

#

it's like with integers, I don't want my base variable to change if all I want to do is foo + bar

young knoll
#

You clone it

#

Or avoid using the location object itself

stiff sonnet
#

yeah I cannot avoid it really

#

I need it a lot

twilit wharf
#

I need to track when a player goes into chunks and loads entities, ones that might already be loaded by another player. (loaded clientside) Is there an event or packet for this?

echo basalt
#

Paper has an event for this

#

spigot has packet manipulation

young knoll
#

Or a runnable

#

Kek

#

Very inefficient I know

rotund ravine
#

oh

#

not if u send packets ofc

echo basalt
#

mans forgot the meeting of clientside

rotund ravine
#

on a vanilla server

twilit wharf
#

I meant if they are already loaded serverside by another player

rotund ravine
#

and a vanilla client

twilit wharf
#

and an additional player loads them in clientside, I want to track that

echo basalt
#

On a vanilla server and client it's synchronized

rotund ravine
#

oh like that

twilit wharf
#

I think I have a solution.

rotund ravine
#

Just listen to the entity spawn packet

twilit wharf
#

yeah

#

Also, my plugin involves showing a entities passenger when a player looks at that entity. Currently, I have a runnable just running in an infinite loop every 5 ticks and loops through every player, and loading the entity's passenger that they are currently look at. I am pretty sure this is the best way do it, however I am not sure. Do you guys have any thoughts on a different approach?

#

This plugin is not designed for large playercount servers (however it would be better if it could handle it)

proud badge
#

whats the purpose of java.lang.Void

lost matrix
#

Generic type argument

#

Call it a "wrapper" for void

proud badge
#

ye but where would I ever use it

#

Or does it exist just because, with no use?

lost matrix
#

Eg, if a future returns an int, then you would have a Future<Integer> because primitives cant be generic arguments.
Same goes for when your Future returns nothing. So void. It would be a Future<Void> because void cant be a generic type.

proud badge
#

hmmmm

ionic thicket
#

im spawining an entity and i want to know from who it is killed. How do I use something like EntityDeathEvent specifying i want that entity to die?

#

How can i differenciate that entity from another one?+

worldly ingot
#

The easiest way is probably to attach some NBT to that entity with its PersistentDataContainer

ionic thicket
#

Yo, I have seen you in a lot of forum

#

im gonna check this out

worldly ingot
#

I know. I'm like a pest. You kind of can't get rid of me

ionic thicket
#

and I appreciate that

chrome beacon
#

?pdc

graceful oak
#

Hey guys im looking into custom generation and have been playing around with biomes on a custom world I am using the BiomeProvider and I am able to make a world all 1 biome but cant seem to get adding more than one biome correct. As of right now I am doing this to generate all desert

public Biome getBiome(@NotNull WorldInfo worldInfo, int x, int y, int z){
        return Biome.DESERT;
    }

Since this returns a single biome I tried doing a 50/50 change of it being a desert or bandlands but it doesnt generate how vanilla minecraft biomes generate it just sets smaller sections of blocks to either be desert or badlands. Is there anyway to get what the vanilla biome would have been then swap it?

#

The BiomeProvider does also come with the getBiomes method which is a list of biomes but I dont really understand the use of it if the getBiome determinse what biome will be given

torn shuttle
#

I almost feel bad for jetbrains, I am actually costing them money right now

#

100%

sullen marlin
#

perhaps using BiomeParameterPoint and basing the biome choice on one of the paramaters in there would work ok

graceful oak
#

alright Ill play around with some things and see what I can get

proven musk
#

how could I store something like an itemstack persistently?
for example, a backpack, or some sort of system that combines similar items into one stack?
could I use something like a bundle?

#

you can't store itemstacks in pdc right

#

where tho

#

i think a bundle would be better

#

if I can change the look a bit

worldly ingot
#

I mean... we could probably implement a PersistentDataType<ItemStack> or something :p

#

I don't know if md would like it in Bukkit but it's definitely possible

proven musk
#

ok so like

#

wait

#

ig this doesn't matter anymore since ores dont drop themselves unless ur using silk touch

#

but when you break natural ores you get xp and when you break placed ores you dont? or at least you didn't

#

yeah you dont

#

how do you tell if a player has broken a natural ore vs a placed one

worldly ingot
#

I don't recall that being the case. Because if you mine it with silk touch you're not getting the drops

proven musk
#

ive confused myself'

worldly ingot
#

That's part of the reason silk touch and fortune can't be applied on the same tool :p

proven musk
#

how does ore xp drops work

worldly ingot
#

Experience will only drop if the item drops. e.g. coal, diamonds, emeralds

#

It won't drop if you mine it with silk touch and get the ore

proven musk
#

do certain ores never give xp

#

imma look at the wiki

worldly ingot
#

I think the ones that aren't smeltable don't give xp

#

So raw iron, gold, and copper won't ever give xp because you smelt the raw ore for experience

proven musk
#

oh right

#

ok well this was all not an issue bc of 1.17

worldly ingot
#

I mean iron, gold, and copper didn't give experience pre-1.17 either. They just dropped the ores themselves

acoustic shuttle
proven musk
#

yeah but im making a tinkers like tool leveling system and I was like oh no! how will I know if they are just breaking and placing the ore! and then I was like oh right

#

thats not a thing anymore

worldly ingot
acoustic shuttle
acoustic shuttle
proven musk
#

😭

#

ok so for adding custom blocks

#

the main strategy is to use noteblocks? and then maybe fuck around with packet stuff to make normal noteblocks look normal

#

but you can't really adjust the properties of the block too much

#

or maybe mushroom blocks?

acoustic shuttle
proven musk
#

idk it doesn't rly do much for being The New Ore They Finally Added

#

decoration and a few recipes just to make it feel less useless

acoustic shuttle
#

ah I see

proven musk
#

tbf thats true for lapis and quartz

acoustic shuttle
#

custom blocks with textures? or you want to use existing textures?

proven musk
#

lapis is the worst because nobody even uses it for building

acoustic shuttle
proven musk
#

yes sorry

#

custom textures

acoustic shuttle
proven musk
#

how do I fix normal noteblocks

#

packets?

#

or does that not work

acoustic shuttle
#

wdym fix?

#

like so the texture is normal?

proven musk
#

yeah

#

bc like

#

I mean it wouldn't be the end of the world but if you make a noteblock that specific note and instrument it would look weird

#

also ermm how would I change stuff like mining time

acoustic shuttle
proven musk
#

haste and mining fatigue change the animation too much

acoustic shuttle
#

best option is probably mining fatigue and using nbt on the block or using yml files for how long it takes to break in ticks and divide it by 10 for each mining stage
if u don't want to use mining fatigue you could still do it but it's going to be annoying keeping them mining without destroying the block/stopping mining together and using the mining stages at the correct pace

proven musk
#

right

acoustic shuttle
#

and it sohuldn't change the animation too much if you just use mining fatigue it'll be a bit slower but It's way easier

proven musk
#

well if its supposed to be an ore or stone block and they try to mine it with a diamond axe then yeah

#

the animation is gonna be slow as hell

merry cove
#

am getting tired, but am I dumb ass or is this the way you do it? am used to paper.

[05:05:36 ERROR]: Could not pass event PlayerInteractEvent to Skyline v1.0
java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_20_R3.entity.CraftArrow cannot be cast to class org.bukkit.entity.Arrow (org.bukkit.craftbukkit.v1_20_R3.entity.CraftArrow and org.bukkit.entity.Arrow are in unnamed module of loader java.net.URLClassLoader @484b61fc)```
```java
Arrow arrow = (Arrow) world.spawnEntity(location, EntityType.ARROW);```
eternal oxide
#

You shaded Bukkit

merry cove
#

wait, what..

#
      <repository>
          <id>spigotmc-repo</id>
          <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
      </repository>
      <repository>
          <id>sonatype</id>
          <url>https://oss.sonatype.org/content/groups/public/</url>
      </repository>
  </repositories>

  <dependencies>
      <dependency>
          <groupId>org.spigotmc</groupId>
          <artifactId>spigot-api</artifactId>
          <version>1.20.4-R0.1-SNAPSHOT</version>
          <scope>provided</scope>
      </dependency>
      <dependency>
          <groupId>org.projectlombok</groupId>
          <artifactId>lombok</artifactId>
          <version>1.18.32</version>
          <scope>provided</scope>
      </dependency>
  </dependencies>```
#

where 😮

eternal oxide
#

your pom looks fine

merry cove
#

then how did I Shade it

eternal oxide
#

why do you have the shade plugin when you are not shading?

merry cove
#

it's there by default with the addon I use, I don't build each pom.

eternal oxide
#

ok

#

however yoru error is definitely due to a shading.

#

open your final jar and see what is in it

merry cove
#

what should I look for spesifically in the jar?

eternal oxide
#

any org/bukkit folders

merry cove
eternal oxide
#

hm

#

Your error doesn;t match what you are showing

sullen marlin
#

also just use spawn(Arrow.class) rather than blind casting

merry cove
#

yea, have no clue..

eternal oxide
#

check the actual jar you are testing on the server.

sullen marlin
#

also make sure your server is up to date

merry cove
#

running a slime jar, whops. ill try another

sullen marlin
#

sigh

merry cove
#

fixed it, :p was testing a world generator thing earlier forgot to change jar

tender shard
#

Classic

lilac dagger
#

is there a system arraycopy but for collection sources?

sullen marlin
#

?xy

undone axleBOT
lilac dagger
#

i have an array of double size and i have a collection, i want to put the collection at a specific position in the array

#

i can do it with a for loop but i don't like it as much

sullen marlin
#

turn collection to array and then arraycopy

lilac dagger
#

i could do that, but i don't like making a copy of the array

echo basalt
#

sounds like premature optimization to me

lilac dagger
#

i'll look through the libraries

#

it's not premature if i'm refactoring the code

echo basalt
#

Did you identify the problem through profiling

lilac dagger
#

no

#

but if i use the profiler just to have runnable code i'd say i did a bad job

echo basalt
#

You use a profiler to identify issues, then you go ahead and fix them

rigid shoal
#

hello its me again, how to read or write a yaml file?

lilac dagger
#

YamlConfiguration.load

#

and for save configuration.save

rigid shoal
lilac dagger
#

@rigid shoal

rigid shoal
stiff sonnet
#

does anyone know of a sleek way to prevent redstone updates entirely? I want to be able to block e.g. torch clocks or repeater clocks until a condition is met

#

all I found was the blockRedstoneEvent, but while that does work for 99% of cases, the block still initially receives power when a block is paced, but not after that

#

there doesn't appear to be a way to override the powered state of a block eitehr

valid burrow
#

never used the redstone update event

#

but what happens when u set the new current to 0 instead of just cancelling the event

stiff sonnet
#

I did that

#

you cannot cancel the event

valid burrow
#

oh

#

welp

#

uh

stiff sonnet
#

gonna try to force the power level to 0 on block updates

valid burrow
#

meeh

#

sounds inefficent

#

what interactions are causing you trouble?

stiff sonnet
#

right maybe I shouldn't cancel all block updates

valid burrow
#

could probably something with packets here

stiff sonnet
#

I guess it's inefficient but this isn't a huge-scale project

valid burrow
stiff sonnet
#

it's not supposed to be purely visual

#

I want it to disable dispenser updates for example

#

whow. The default is supposed to be a few hundreds of thousands. I think minecraft is constantly trying to update these blocks

upper hazel
#

Please advise how you can turn an object into a string without checking the object type through instenciof. Alternatively, I tried to use map and associate the adapter class with the element class type, but this is more like reflection and it is slow, what should I do?

upper hazel
#

not this

#

just connect adapter with object

hazy parrot
#

well you can't really deserialize string to specific object if u dont know its type

#

if that is what ur asking

#

and idk why Map<Class, Adapter> would be slow

upper hazel
#

reflection is slow

hazy parrot
#

how are u using reflection in this case ?

#

u are just calling getClass

#

and reflection isn't that slow anymore regardlessly

upper hazel
#

then when this will be slow?

hazy parrot
#

i mean reflection isn't as slow as it used to be

#

if u are that concerned about a performance do a benchmark

tender shard
#

iirc reflection is faster than calling native methods

#

custom, native methods ofc (like JNI)

echo basalt
#

Uh

#

Great question

#

Something something MethodHandles faster than reflection

#

P sure native is quick but has overhead due to cpp conversion

tender shard
#

Yeah haha

#

Pretty sure reflecting is fine as long as one caches the methods or classes or whatever :3

tender shard
#

But as said, that‘s ofc only true for „custom“ native methods - native jdk methods like hashCode() are fast

echo basalt
#

Prob something to do with converting params

#

If everything's primitive it might be a lot quicker to convert

tender shard
#

Yep sth like that

rigid shoal
echo basalt
#

same exact thing

lilac dagger
#

it's in the screenshot @rigid shoal

rigid shoal
tender shard
#

isnt there a spigot wiki article about custom YAML files?

#

?customconfig

fallen eagle
#

Hello, how can I do that in the config.yml there is an option to enable/disable chat moderation, and if its disabled ignore all parts of the moderation?

dawn flower
#

is there an event for changing your main hand item?

#

without abucnh of listeners

tardy delta
#

tbh this config wiki is way better than the spigot one (last time i checked) https://bukkit.fandom.com/wiki/Configuration_API_Reference

BukkitWiki

The Configuration API is a set of tools to help developers quickly parse and emit configuration files that are human readable and editable. Despite the name, the API can easily be used to store plugin data in addition to plugin configuration. Presently only YAML configurations can be used. The API however was designed to be extensible and allow ...

fallen eagle
#

I know more or less what i have to do but i do not know how

tardy delta
#

read that documentation and check out getBoolean()

fallen eagle
stiff sonnet
#

https://imgur.com/E5vDXF7 any idea how I'd iterate over all dispensers in an area? I tried this, but I don't get anything, and with type == Material.Dispenser I couldn't cast it to Dispenser

tardy delta
#

bruh here too

stiff sonnet
#

ugh I cannot just do this on a chunk-per-chunk basis

tender shard
#

why not? you can still check whether they're in your area or not

stiff sonnet
#

it'd be much more annoying to find the chunks than to just iterate over all blocks

tender shard
#

no

fallen eagle
#

Hello, I want to make the welcome message and I have this
@EventHandler
public void onJoin(PlayerJoinEvent event) {
// Coordenadas al entrar : 0 0 0 0 0 world
Player player = event.getPlayer();
MainConfigManager mainConfigManager = plugin.getMainConfigManager();
if (mainConfigManager.isWelcomeMessageEnabled()) {
List<String> message = mainConfigManager.getWelcomeMessageMessage();
for (String m : message) {
player.sendMessage(MessageUtils.getColoredMessage(TekoCore.prefix+m.replace("%player%", player.getName())));
}
}
player.setGameMode(GameMode.CREATIVE);
Location location = new Location(Bukkit.getWorld("world"),23.38,64.0,-10.2,0,0);
player.teleport(location);
}

And in the config
config:
welcome_message:
enabled: true
message:
- "&a&m "
- ""
- "&fBienvenido &2%player% &fa &5&lTeko&f&lCraft"
- "&fEsperemos que disfrutes de tu estancia"
- "&fDiscord: &btekocraft.com/discord"
- ""
- "&a&m "

But nothing on the onJoin function works

stiff sonnet
# tender shard no

my iteration block can go anywhere from one to three chunks in both the x and z direction, and I have no idea how I'd get the chunks efficiently

tender shard
#

you have three options:

  1. Store the locations in the first place
  2. Loop over all blocks (not so good)
  3. Get all chunks in the area (or chunks that intersect it) and then loop over getTileEntities

#3 is by far the best way imho, or #1

tender shard
twin venture
#

Hi , iam remaking my death system and i was woundering if it will be better to just use PlayerDeathEvent , or use EntityDamageByEntityEvent?
and check if player health is less than the damage taken if so , respawn , give kit .. etc

tender shard
#

blocked

tardy delta
#

use code blocks please

undone axleBOT
stiff sonnet
tender shard
tender shard
#

what's your actual goal?

twin venture
#

that's how iam checking ..

inner jewel
#

i want a make a ffa pvp server server cant coudn't find a suitable plugin which has much features

tender shard
twin venture
#

me , its coding related question

fallen eagle
fallen eagle
tardy delta
stiff sonnet
tender shard
# fallen eagle Wtf why?

don't ping me for random questions. Do not say "HELP ME, IT'S IMPORTANT" just because you didn't get an answer within 83 seconds

twin venture
#

i have 2 problems with the PlayerDeathEvent ..
1- i want when player die , remove the respawn screen .
2- respawn , remove the droped kit items only , and keep the other to be droped normally .

tender shard
fallen eagle
#

Why cant i ssend photos

rough ibex
#

I don't

tender shard
undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

tardy delta
tender shard
twin venture
#

yeah ik but what if he died by a cause that is not player related?

#

lets say lava , or fall , or other?

#

how i can check?

tender shard
#

it's called sth like that

#

that will return the last EntityDamageEvent

twin venture
tender shard
#

yep

#

now you can check if it's instanceof EntityDamageByEntityEvent

twin venture
#

ok so i need check if killer is null which means he died by player or by lava or other

fallen eagle
#

Hello, I want to make the welcome message and I have this
@EventHandler
```public void onJoin(PlayerJoinEvent event) {
// Coordenadas al entrar : 0 0 0 0 0 world
Player player = event.getPlayer();
MainConfigManager mainConfigManager = plugin.getMainConfigManager();
if (mainConfigManager.isWelcomeMessageEnabled()) {
List<String> message = mainConfigManager.getWelcomeMessageMessage();
for (String m : message) {
player.sendMessage(MessageUtils.getColoredMessage(TekoCore.prefix+m.replace("%player%", player.getName())));
}
}
player.setGameMode(GameMode.CREATIVE);
Location location = new Location(Bukkit.getWorld("world"),23.38,64.0,-10.2,0,0);
player.teleport(location);
}


```config:
  welcome_message:
    enabled: true
    message:
      
"&a&m                                       "
""
"&fBienvenido &2%player% &fa &5&lTeko&f&lCraft"
"&fEsperemos que disfrutes de tu estancia"
"&fDiscord: &btekocraft.com/discord"
""
"&a&m                                       " ```

```But nothing on the onJoin function works```
twin venture
#

how i can do this best design?

tender shard
twin venture
#

oh so you mean in PlayerDeathEvent i check if the killer is null then return

#

and in the other events EntityDamageEvent

#

i do the check for last damage

#

right?

tender shard
rough ibex
#

also ensure your config manager is correct

#

maybe try translation keys

tardy delta
tender shard
tender shard
undone axleBOT
rough ibex
#

write valid YAML?

twin venture
#

i just want to make a good and decent death system for my skypvp plugin , so when a player die , give him stats , and killer too , and respawn the player who died , and give him kit .. etc

fallen eagle
fallen eagle
twin venture
#

i do have a combatLog so i can do :
combatlog.get(entity) -> this will give me the attacker

valid burrow
tardy delta
rough ibex
#
can not read an implicit mapping pair; a colon is missed (6:46)

 3 |  ... rue
 4 |  ... 
 5 |  ... 
 6 |  ...                               "
-----------------------------------------^
 7 |  ... 
 8 |  ... &2%player% &fa &5&lTeko&f&lCraft"```
#

yamlchecker throws

tender shard
fallen eagle
#

There is more file

fallen eagle
twin venture
valid burrow
rough ibex
#

so you cut off parts of your yaml

#

in the middle of it

twin venture
#

now if i hit the player 1 hit , he will die

tender shard
#

that will break all plugins that rely on the actual Death event

valid burrow
rough ibex
#

fuck you I got mine

tender shard
#

using the damage event is only okay if you actually wanna cancel the player dying

fallen eagle
#

What happens to my pl then?

tender shard
valid burrow
rough ibex
#

then why are you on grindr?

#

actually

twin venture
rough ibex
#

nevermind i can imagine

valid burrow
#

then*

tender shard
tardy delta
tender shard
valid burrow
#

event*

tardy delta
#

ah ye

valid burrow
#

its not

tender shard
#

at least not when using spigot

#

I think paper made it cancellable

tardy delta
#

maybe mess with priorities

tender shard
twin venture
valid burrow
#

so you gotta respawn the player yourself

tender shard
#

@twin venture just write your code. Use the DeathEvent, check the damage cause. Come back here if you encounter issues

#

do not listen to people who complain all day haha

#

where are we? at the finanzamt?

valid burrow
#

whats that supposed to mean lol he asked a question and i answered

tender shard
#

dw it wasn't meant as insult or anything

#

I only noticed that he wanted to get the job done and then he kept asking questions instead of just getting the job done

twin venture
#

alright , iam sorry i just want to make it as perfect as possible to big servers :p

valid burrow
#

well u can always fix stuff up later

#

get it functioning first

tender shard
#

I got the most popular death chest plugin on spigotmc so pls listen to me when it comes to deaths and stuff haha :p

valid burrow
#

alex do u wanna rate a concept i made for my rpg game

twin venture
#

its weird the system i have now , with EntityDamageByEntityEvent works just fine , with 1.8 , but when i use it for 1.20.4 , when i hit the player once , welp he is dead

#

the health is 20 , and i hit him once and bom die

tender shard
#

you're much better off asking 7smile

valid burrow
tender shard
#

or, if you like to get humiliated, ask frostalf

#

but sure, paste your code if you wanna get it reviewd by me

valid burrow
tender shard
valid burrow
tender shard
#

gimme github if you want a review

tender shard
valid burrow
#

lemme move this to general

tender shard
#

ok

wet breach
vital void
#

Hi, anyone here handy with nms and 1.20.4

#

sending chunk updates,

#

packet sends but does not update on the clients end

sullen marlin
#

?xy

undone axleBOT
tender shard
tender shard
#

no need for NMS, unless there's an ?xy as md already said

twin venture
#

hmm weird

#

player is dying

#

this is how i have it rn ..

vital void
rigid shoal
# lilac dagger it's in the screenshot <@1151766881833852949>

i tried to get "world" but it gave me null instead
code:

try {
        Player player = (Player) sender;
        File yml = new File("plugins\\GDP\\DD\\DD.yml");
        YamlConfiguration ymlconfig = YamlConfiguration.loadConfiguration(yml);
        String world = ymlconfig.getString("world");
        ymlconfig.save(yml);
        player.sendMessage(ChatColor.GREEN + "You died at " + world);
      } catch (IOException e) {
        throw new RuntimeException(e);
      }

yaml file:

player-ruthresh266:
  world: overworld
  X: 182
  Y: 0
  Z: 17
vital void
#

you need to acess it via the section

#
try {
        Player player = (Player) sender;
        File yml = new File("plugins\\GDP\\DD\\DD.yml");
        YamlConfiguration ymlconfig = YamlConfiguration.loadConfiguration(yml);
        String world = ymlconfig.getString("player-" + player.getName()+ ".world");
        ymlconfig.save(yml);
        player.sendMessage(ChatColor.GREEN + "You died at " + world);
      } catch (IOException e) {
        throw new RuntimeException(e);
      }
heady leaf
#

how can i make a slot infinite?
for example if i have 64 diamonds in a slot and i pick up another diamond i want to store it in the same stack so 65 diamonds in the same slot.

shadow night
#

You can't make it infinite

#

And storing more than the limit in a stack will cause client sided pain

heady leaf
#

even if it is a different gui? not the player's inventory.

shadow night
#

Any gui

heady leaf
#

:/

shadow night
#

You can make an item stack above the usual limit, but it'll be broken on the client and there is a limit

tall dragon
#

you could make something like that with the item's name or lore. but u cant rlly display a massive number as the amount

heady leaf
#

ok, i will do with lore than 🙂

#

thx

twin venture
#

i fixed my problem i was missing a return xD

twin venture
#

is this Efficent way to combine armors , and contents of player inventory?

tall dragon
#

im fairly certain #getContents() already contain the armor in modern versions

twin venture
#

well , for older ver no so ..

tall dragon
#

😔

icy beacon
#

btw is it just me or does bt for 1.8.8 not work anymore

tall dragon
#

doesnt spigot have Apache commons?

#

u could use ArrayUtils.addAll(first, second)

eternal oxide
tall dragon
#

not sure if that lib is included tho

twin venture
#

i already have support for 1.20.4 , and i will support latest version only

#

but i want 1.8.8 for my own server

uneven crater
#

is it possible to make a stick enchantable in a enchanting table?

icy beacon
#

bt.jar gets the farthest basically

eternal oxide
#

yeah I remember somethign about the jars being moved

icy beacon
#

never heard of it ☹️

#

thankfully i have run bt in like october or september successfully

#

but now it does not work

sullen marlin
#

?1.8

undone axleBOT
sullen marlin
#

I mean you can open a bug report so at least it's tracked

icy beacon
icy beacon
sullen marlin
#

Yes

icy beacon
#

tyty

#

?jira

undone axleBOT
icy beacon
#

Opened an issue

rigid shoal
#

hello how do i write in yaml file using YamlConfiguration?

eternal oxide
#

?configs

undone axleBOT
ionic thicket
#

yo, is it possible to add a method into Entity interface?

#

i want to add a method that checks whether that entity is or is not a boss

eternal oxide
#

a boss?

ionic thicket
#

yeah a custom mob i created

eternal oxide
#

add a PDC tag to them when you spawn it

twin venture
#

or NBT if you use older minecraft version :p

ionic thicket
eternal oxide
#

?pdc

eternal oxide
#

If you are not good with OOP and don't understand then creating custom mobs is not a good idea.

ionic thicket
#

it's not that i dont know it: i just have some doubts about some specific stuff. Also i dont really know when i should create a class or when i should just code it in the main method

inner mulch
#

is there an event for listening to lightlevelchanges?

young knoll
#

No

inner mulch
#

is a hard reference to an entity only bad if i forget to clean up the memory or is this always bad practice?

young knoll
#

Generally it’s fine as long as you get rid of it when the entity is no longer around

inner mulch
#

okay

#

is it possible with an enum, to have multiple method implementations? or do they need to same?

tardy delta
#

an enum is just a class

#

hold a functional interface id say

inner mulch
#

alr

crystal knot
#

How can I make a config file looking like this :

playlists:
   playlist-1:
      - "yes"
      - "test"
      - "cool"
   playlist-2:
      - "yes2"
      - "test2"
      - "cool2"
young knoll
#

playlists is a section

#

playlist-1 and -2 are string lists

crystal knot
#

but if i want to make the player able to create many playlist they want ?

#

can i get how many list the section playlist have ?

young knoll
#

You can loop over all the keys in it

#

With ConfigurationSection#getKeys

crystal knot
#

ok thanks !

crystal knot
#

How can i get the duration of music/sound with the name but it's not always a sound from the Sound enum ? (like a sound added by a resourcepack

stiff sonnet
#

is there a way for me to prevent water from flowing to a certain block? I have a flower that could be washed away, which I want to prevent.
If that is something you can disable with block updates then I could use it for other stuff too, which I also need

young knoll
#

BlockFromToEvent

stiff sonnet
#

oh thanks!

rigid shoal
#

how do i fix this error when writing a yaml file

#

and the yaml is cleared out

eternal oxide
#

do not touch your config until after worlds are loaded if you store Locations/Worlds in it

stiff sonnet
#

I wanna do some stuff with water and any idea why this doesn't just work?

void onBlockPlace(BlockPlaceEvent e) {
    if (world.getBlockAt(e.getBlock().getLocation()).getType() == Material.WATER) {
        e.setCancelled(true);
        return;
   }
eternal oxide
#

You don;t "place" water blocks

#

its teh bucket empty event

stiff sonnet
#

this is about placing a block in a water source block

#

I wanna cancel that

eternal oxide
#

ah ok

inner mulch
#

is it a design issue when one manager needs another manager as dependency?

stiff sonnet
#

oh thanks my intellij wasn't showing that

rigid shoal
eternal oxide
#

when the server is done loading

mighty gazelle
#

How can I send player from the Lobby server to a another server but the request is from the plugin of the Lobby server

eternal oxide
#

?pmc

rigid shoal
eternal oxide
#

?paste your yaml

undone axleBOT
mighty gazelle
eternal oxide
#

there is already an example on that wiki

mighty gazelle
eternal oxide
eternal oxide
#

That yaml is not giving that error

rigid shoal
#

i think its a player die event

eternal oxide
#

That is not the yaml you are reading

rigid shoal
eternal oxide
#

the yml you just posted is NOT the yml you are trying to load

#

look at the actual yml file you are trying to read

rigid shoal
#

so you saying that this path is dont lead to the yml?

File yml = new File("plugins\\GDP\\DD\\DD.yml");
lilac dagger
#

most likely

eternal oxide
#

look at the actual yaml

lilac dagger
#

use this

eternal oxide
#

that File is fine

#

open the yaml file and look IN it

lilac dagger
#

File yml = new File(getDataFolder(), "filename.yml");

eternal oxide
#

the data IN the file is not the data you posted

rigid shoal
eternal oxide
#

I'll make it simpler.
When you write teh data to the config you are trying to store an actual World instead of World#name()

eternal oxide
#

teh file is most certainly not empty

rigid shoal
#

thx it works now

sand spire
#

I couldn't find a simple way of doing this but you could get the entities close to the player immediately after the event and filter out the arrows, then use projectile#getShooter to get the ProjectileSource and cast it to Player

icy beacon
#

This will be wrong if an arrow is flying near a player already, e.g. he's getting shot by an arrow as he's shooting

#

Meaning that there will be some false positives

sand spire
icy beacon
#

Though you could check if the shooter is the aforementioned player

#

That'll work

#

Yes

#

Missed that part

flint coyote
#

well then the shooter will be someone else. Did you try the ProjectileLaunchEvent? Or does that not trigger for crossbows?

sand spire
flint coyote
#

in that specific case

icy beacon
#

👍

flint coyote
#

As I mentioned earlier, there might be a ProjectileLaunchEvent for every arrow

#

Could use that, too

worldly ingot
#

I could be wrong, but I feel like I remember there being some quirk with the EntityShootBowEvent being called 3 times, once for each arrow of a multishot crossbow

flint coyote
#

If that a requirement then you'd have to check for the item in the main hand - if that isn't a bow/crossbow it was the offhand.
But yeah both solutions require some additional checks in this case

worldly ingot
#

Again, I could be misremembering, but at the time of implementation, I think the initial draft had a EntityShootBowEvent and an EntityShootCrossbowEvent

#

Or maybe that was still a WIP for crossbow support

#

Ah okay so that is an existing quirk. And I'm not going crazy, because yes, Diamond did pull request like 5 new events, one of which included EntityShootCrossbowEvent which includes all launched projectiles in a list

#

It was just never merged

#

AbstractArrow does have a isShotFromCrossbow() method though (or something similarly named)

stiff sonnet
#

and idea how to get the minecraft gravity value from within bukkit?

#

I think it's the 9.81 meters per second like in real life, but I'm not sure

#

does seem a bit high though

shadow night
stiff sonnet
#

I can't "just" measure it

shadow night
#

why

stiff sonnet
#

I'd have to create a whole test setup

#

I don't know if I could get the velocity via minecraft commands

#

I could try that

shadow night
#

Why, can't you just check how long it takes to fall down 10 blocks

#

And then use that info

stiff sonnet
#

that is most inaccurate

shadow night
#

100 blocks then

stiff sonnet
#

oh there we go, tnt has a max velocity of -1.1 when falling

#

question is what exactly that means

#

oh yeah that divided by 20 is the velocity each tick, which is 0.055 blocks

sand spire
stiff sonnet
trim quest
#

i have issue about my custom config file

stiff sonnet
trim quest
#

does anyone can help?

#

my code looks does not do anything about content.

stiff sonnet
undone axleBOT
trim quest
#

it just create empty file there is no error appear

trim quest
versed cliff
#

Hello sir I want help

trim quest
#

Have you reviewed the code?

versed cliff
#

Today when i do stream I don't how more players join our server and from more ips nonstop join my server can you help me how to solve this problem

#

I need help please help me please 🥺😭

stiff sonnet
# young knoll The permission string

but what exactly is the permission string. How do you get it? Where does it come from? The permissible type that is linked has seemingly nothing to do with that

tall dragon
young knoll
#

It's just a string

young knoll
#

It can be whatever you want it to be

stiff sonnet
#

what

#

bruh

versed cliff
young knoll
#

for example

#

"essentials.command.warp"

versed cliff
tall dragon
stiff sonnet
#

also this isn't development related is it? So go to #help-server please

versed cliff
tall dragon
#

so u want to block people from joining

stiff sonnet
#

either

  1. whitelist
    or
  2. player limit in the config
versed cliff
stiff sonnet
#

why would you set your player limit to a value that your server cannot handle

young knoll
#

I mean most servers tend to do that

#

kek

versed cliff
stiff sonnet
# young knoll "essentials.command.warp"

do I need to do anything else to make that work? I'm getting zero text in the chat: IslandWars.plugin.getServer().broadcast("Broadcasting!", "islandwars.broadcast");

young knoll
#

Do you have that permission

versed cliff
#

They not stay in my server

#

I don't know and plugin to stop the issue

stiff sonnet
young knoll
#

If that's all you want

stiff sonnet
#

I guess I'll just iterate over all players instead

young knoll
#

use broadcastMessage

stiff sonnet
#

that is deprecated though

young knoll
#

You are using paper's api

#

Ask them

stiff sonnet
#

I created a spigot plugin

young knoll
#

¯_(ツ)_/¯

#

Change the dependency in maven/gradle

stiff sonnet
#

I guess the mcdev intellij plugin is trolling then. Ill just use broadcastMessage

#

thanks!

young knoll
#

Also you can just do Bukkit.broadcastMessage

trim lake
#

What is best way to edit inventory title without NMS is that possible? I´m using version of MC where u cant change inventory title with API. I need to display weight of the inventory next to title, or what would be best other way to do that?

young knoll
#

Packets

stiff sonnet
young knoll
#

yes

stiff sonnet
#

bruh

#

let me just replace that in like 50 different places

young knoll
#

Everything in the server class is also available statically in Bukkit

trim lake
# young knoll Packets

so NMS fck, I was thinking if I can display next to inventory or somewhere... can I send 2 lines in action bar? 🤔

young knoll
#

Not without resource pack magic

#

also you don't need NMS for packets, there are third party apis you can use

#

(Protocollib and PacketEvents)

fallen eagle
#

Hello, I have a problem with my pl, when I enter the welcome message does not appear

public class PlayerListener implements Listener {
    @EventHandler
    public void onJoin(PlayerJoinEvent event) {
        // Coordenadas al entrar : 0 0 0 0 0 world
        Player player = event.getPlayer();
        MainConfigManager mainConfigManager = plugin.getMainConfigManager();
        if (mainConfigManager.isWelcomeMessageEnabled()) {
            List<String> message = mainConfigManager.getWelcomeMessageMessage();
            for (String m : message) {
                player.sendMessage(MessageUtils.getColoredMessage(m.replace("%player%", player.getName())));
            }
        }
        Location location = new Location(Bukkit.getWorld("world"),23.38,64.0,-10.2,0,0);
        player.teleport(location);
    }
}

And here is the config.yml

# Creado por mgt46
# Este plugin es exclusivo para el servidor TekoCraft Network

messages:
  prevent_block_break: " &cNo puedes romper bloques aquí!"
  command_with_console: " &cNo puedes ejecutar este comando desde la consola!"
  insufficient_perms: " &cNo tienes permisos para ejecutar este comando!"
  plugin_reloaded_successfully: " &2La configuración ha sido cargada correctamente!"
config:
  welcome_message:
    enabled: true
    message:
      - "&a&m                                       "
      - ""
      - "&fBienvenido &2%player% &fa &5&lTeko&f&lCraft"
      - "&fEsperemos que disfrutes de tu estancia"
      - "&fDiscord: &btekocraft.com/discord"
      - ""
      - "&a&m                                       " ```
trim quest
#

My issue :
I have a SkullService class that creates a Custom Skull. This class works dependent on custom-heads.yml. Users enter the mcheads data they find on the internet into this file, and SkullService reads this data and creates the desired custom skull. If there is an typo in this file from which this class reads the data, it must delete the incorrect part. Additionally, this class must create custom-heads.yml in a specific format from the moment it is created. The format is attached. My problem is that it cannot create files in this format.
the file Format:

custom-heads:
   example-head: 
      name: Football Player
      minecraft-url: 5d62376f56fe8b56a019a5624e17efae73639c97e6e84d84786be269202ac21b
      value: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNWQ2MjM3NmY1NmZlOGI1NmEwMTlhNTYyNGUxN2VmYWU3MzYzOWM5N2U2ZTg0ZDg0Nzg2YmUyNjkyMDJhYzIxYiJ9fX0=
   milenium-head: 
      name: 
      minecraft-url: 
      value: 
   erano-head: #for example erano-head should deleted

      name: 
      minecraft-url: 

Does anyone can help ?

young knoll
#

Why can you not create files in that format

fallen eagle
young knoll
#

That's just standard YML

trim lake
# young knoll Not without resource pack magic

how can I do resource pack magic, then? I have no clue how to work with resourcpacks tbh. I will probably do NMS way than.. still need to learn that so thats sound like good start to learn that

stiff sonnet
#

it's not that long

eternal oxide
fallen eagle
trim quest
#

i will share my code you guys can understand me

stiff sonnet
#

debugging is when you substitute random parts in your code for very simple bits until it works, then then you find out why the part you removed is not working

trim quest
fallen eagle
trim quest
#

@young knoll what do you mean ?

kind hatch
stiff sonnet
fallen eagle
#

But idk why the person in the tuto works and mine no

stiff sonnet
trim quest
#

but the file is not created as i set

#

review the code

fallen eagle
kind hatch
#

?paste

undone axleBOT
tall dragon
#

thus it defaults to false

obsidian drift
#

Do you guys think it would be possible adding new biomes with unique terrain generation through plugins only without forking Spigot?

fallen eagle
tall dragon
#

change it to the correct path

#

config.welcome_message.enabled

kind hatch
fallen eagle
tall dragon
#

np

fallen eagle
#

Do u know how to upload to git?

tall dragon
#

google ;d

kind hatch
# trim quest

Sooo, not sure where this is going wrong. It works in my testing.

rough ibex
#

git is entirely local

#

on your machine

rough ibex
#

you can add changes and then commit that

kind hatch
trim quest
#

test on server

#

did you test on server

kind hatch
#

Doesn't matter if I do or don't. This code works.

trim quest
#

ok ok maybe

#

my constructor ruined everything

hybrid turret
#

how would i customize a player's name in a tablist? nms?

trim quest
#

you only tested verifyExistingContent() method right ? @kind hatch

tall dragon
hybrid turret
#

oh- there's a method for it???????

#

LOL

kind hatch
tall dragon
trim quest
#

this is more important

hybrid turret
trim quest
#

i dont wanna delete existing custom-heads.yml

hybrid turret
#

also which version?

kind hatch
tall dragon
hybrid turret
#

let me guess, 1.20?

tall dragon
#

fairly modern version

#

probably

hybrid turret
#

damn

#

i'm on 1.19.4

tall dragon
#

not sure where exactly it was introduced

trim quest
#

findOrCreateFile() is not working properly

tall dragon
#

check that

#

mah bad

hybrid turret
#

ahhh

#

ty

trim quest
#

@kind hatch

remote swallow
#

that seems convoluted

trim quest
#

each SkullService constructor call will iterate existing file

remote swallow
#

why not just


FIle customHeads = new File(plugin.getDataFolder(), "custom-heads.yml")

if (!customHeads.exists()) {
    plugin.saveResource("xxxx")
}

load
hybrid turret
#

i also absolutely can't get my skin changing to work, it's so annoying

#

ffs

#

i even send the respawn packet

hybrid turret
#

I'm trying to change the DisplayName. GP-Name and TablistName

trim quest
kind hatch
trim quest
#

thanks @kind hatch

tall dragon
#

iirc

hybrid turret
#

yeah

trim quest
#

At least we know 1 method is working properly.

hybrid turret
#

i managed to change the displayname using Player#setDisplayName and the GP-Name using NMS and Reflection

#

but the tablist name won't change fsr

tall dragon
#

¯_(ツ)_/¯

hybrid turret
#

welp

#

eh, enough for today anyway

kind hatch
trim quest
kind hatch
#

Not really. It's just file iteration.

#

Spigot supports yml out of the box and if that's the format you want to go with, it makes it really easy.

#

You also already have the core classes to do it.

#

FileConfiguration & YamlConfiguration

trim quest
#

ok i will split

#

but find name for me 😄

#

doing abstraction is hard for files i readed this somewhere. you cannot do inheritance for each file type

#

for me i want to seperate them

remote swallow
#

why find by name

twin venture
#

hi , trying to make something a bit hard and simple . so how i can make this command system way better , by making it not needing to register in plugin.yml

remote swallow
#

if you know the name you can just get it directly and check if exists

kind hatch
#

Honestly, the file name is irrelevant if you have a good file structure are only going to iterate over the entire subfolder.
At that point, the file contents are all that matters.

remote swallow
#

if its a subfolder then the names are irrelevant

#

ye

trim quest
#

you mean seperating yml and Skull ?

kind hatch
#

Each skull would get its own file.

trim quest
#

Frankly, I want to write something like SkullRepository and treat the file needed here as a database.

lilac dagger
maiden thicket
kind hatch
#

Made a similar system at one point. (No file verification yet)

trim quest
#

This seems logical, but what do you do when you do something related to these player heads, for example when it comes to deletion?

kind hatch
#

In that system, all you would have to do is delete the file.

#

Then reload the data

trim quest
#

loosely coupling is more important.
I think the only mistake in the Skull Service I wrote is that I cannot establish the Repo-Service relationship.
It is better to depend on one file than to depend on multiple files.

#

I mean separating files is not exactly something that reduces coupling. Sometimes it will increases coupling

proven musk
#

How o you get the displayed name of an item. I tried ItemMeta.getDisplayName() but it gave me this for an item that hasn't been renamed

young knoll
#

If it doesn't have a custom name it doesn't technically have a name server side

proven musk
#

do I just need to implement my own method for this

#

it feels like something that should definitely be there already but whatever

young knoll
#

Just a translation key, which you can get via Material#getTranslationKey

robust pebble
#

PluginNAME\build\libs is where u get ur jar files right...

#

for building

proven musk
#

yeah but Id just set it up to copy into your plugins folder

robust pebble
#

aight

#

been forever since my las plugin

restive mango
#

How bad is it to pass something an Object[] which have to be cast back to being int/doubles/strings etc instead of just like an actual int, double, string, etc.

rotund ravine
#

i mean it's just annoying

restive mango
#

I'm just looking into making some effects that can either be triggered by command or by clicking with a particular item, and those effects have various parameters that can be changed

#

ugh i feel like there's definitely a better way to do this

#

@rotund ravine would you be fine

#

if i explained it in more depth

#

and you gave me your thoughts on if there is a better way to do this that I'm missing?

#

the ultimate issue is i made all the effect classes implement a general interface class

#

which has a 'use' method

#

void use (Player p, Object[] parameters);

eternal night
#

I mean instead do something like

interface Effect<P> {
  use(Player p, P effectParams);
} 
eternal night
#

Object[] param is just fucking terrible as you don't get compile time safety for the arguments you are passing

restive mango
#

what would P effectParams be though

eternal night
#

param typee

restive mango
#

so like a class which has lists of different variables?

eternal night
#
class FireEffect implements Effect<FireEffect.Params> {
  record Params(int range) {}

  public use(Player p, Params params) {}
}
#

now, if you have them in some Map<String, Effect>, you'll still not get complete type safety as you'll have to do some unchecked casts

blazing ocean
eternal night
#

but better than not knowing anything about the param order

restive mango
#

hrm

celest notch
#

Does anyone know how to check the blocks next to a player relative to their position, i am trying to make wallrunning and walljumping for an rpg

orchid trout
restive mango
#

What I'm thinking of doing is having a general Params class which can be passed to any of the effects, and stores arrays of the params, and then just a list of an enum where the current enum is the paramtype for the current param slot

#

e.g. an effect which takes the params int double int int string

#

would have say five lists

#

one particle, empty

#

one double, with 1 entry

#

one int, with 3 entries

#

one string, with 1 entry

#

one material, empty

#

and then one of the enum lists

#

which would be INT, DOUBLE, INT, INT, STRING

#

@eternal night what do you think?

eternal night
#

code it and see if you like it

restive mango
eternal night
restive mango
#

what

eternal night
#

make the type static then

#

but in the end, code up the system, implement the first couple effects and if it absolutely blows, revisit and try something else

restive mango
#

wait

#

LOL

#

im wrong

eternal night
#

Object[] is just annoying as fuck for both the effect and the caller.
If you want the range of a fireeffect, is that the first or second integer?

#

same goes for calling it

#

you are relying on a contract that cannot be enforced whatsoever

tardy delta
#

laughs at you in javascript

tall dragon
remote swallow
#

1 + 3?

#

sorry

#

.1 + .3

orchid trout
#

non overridable, not final method how

tall dragon
#

why??

tardy delta
#

why not final

upper hazel
#

chat support /n for line break?

rotund ravine
#

no

upper hazel
#

dem how i shold add list string to placeholder api...

orchid trout
#

in the whole world

young knoll
#

Does laying down count as sitting?

rotund ravine
#

I saw some do like

%playertops_first%
%playertops_second%

etc

tardy delta
#

standing

rotund ravine
young knoll
#

I mean if laying down is sitting then probably sitting

#

Cuz yknow

#

sleep

upper hazel
orchid trout
#

sleeping isnt sitting

#

or laying down isnt sitting

rotund ravine
young knoll
#

Probably standing then

shell robin
#

How can I create a sign in 1.20.4?

rotund ravine
#

How have you tried

shell robin
#

I'm trying sign.setLine() but its deprecated

rotund ravine
#

what does it say

young knoll
#

I saw that

tardy delta
#

you saw what

eternal night
#

setLine(10, "dummy")

shell robin
young knoll
#

"may" "multiple" I'm pretty sure it's always exactly 2 smh

shell robin
remote swallow
#

my sines are triangular

young knoll
#

Sines

#

I didn’t know sine waves could be triangular

shell robin
winter galleon
#

is there an event when i hover a player with my crosshair?

young knoll
#

No

winter galleon
#

something similiar? like player targeting or some shi like this?

stiff sonnet
#

ugh any idea why I cannot give myself an item with the material redstone_wire, only redstone being possible, but when I mine the redstone it's suddenly redstone_wire?

tender shard
tender shard
#

any error messages?

young knoll
#

redstone wire is a block

stiff sonnet
young knoll
#

Not an item

stiff sonnet
#

it's the dust

young knoll
#

Yes

#

But it’s only a block

stiff sonnet
#

that's waht I get when I give myself redstone

young knoll
#

Redstone is the item form

stiff sonnet
#

why would there be two item IDs for the same thing

young knoll
#

Ask Mojang

stiff sonnet
#

now I need to add some stupid workaround to my pretty neat inventory manager

young knoll
#

BlockData#getPlacementMaterial

stiff sonnet
#

is that available on all blocks or only on some?

young knoll
#

It’s on BlockData

#

So all blocks

stiff sonnet
#

ok, thanks I'll give that a try

#

awesome, that worked! Thank you so much!

young knoll
#

This is what happens when material isn’t separated :(

stiff sonnet
#

to be honest I can't remember fabric having that problem. The one thing that I remember annoying me from the very beginning is how bukkit material names are somehow mostly coherent with the in-game names and somehow partly so vastly diverging that it's actually annoying to find the material names at times

young knoll
#

We’ll get the split to ItemType and BlockType done eventually

shell robin
kind hatch
young knoll
#

That wasn’t directed at you

#

Have you tried the code you wrote

shell robin
young knoll
#

My guess is paper api

shell robin
#

Oh 🤦🏻‍♂️

#

My bad

inner mulch
#

can getBlock from a location be null?

#

maybe if its air

rotund ravine
#

a block in the world

#

will never be null

#

location can be messed up though

inner mulch
#

i feel like its returning null

rotund ravine
#

guess ur location is borked

rotund ravine
young knoll
#

If the location has no world it might Bork

inner mulch
#

i will test it now

#

okay it cannot be null so it ahs to be something else causing the error

rotund ravine
#

What is ur code

inner mulch
#

im gonna debug now

rotund ravine
#

show code

#

I'll debug with my brain

inner mulch
#

no im fine

rotund ravine
#

i promise a 15% success rate

inner mulch
#

wait

#

i will show when im at my end point

#

but i think i have the solution

inner mulch
rotund ravine
#

yes

inner mulch
#

thats the problem

#

so

rotund ravine
#

Obviously it returns 1

inner mulch
#

im just gonna player.getY + eyelocation

rotund ravine
#

getEyeLocation

#

i linked that for ya too

inner mulch
#

yeah but that creates a new location

#

right?

rotund ravine
#

Don't overoptimize lel

inner mulch
#

but when i can why not?

rotund ravine
#

Cause that's dumb

inner mulch
#

nah

sand spire
rotund ravine
#

u haven't left anything empty

young knoll
#

Because you are calling super.registerGoals

sand spire
#

oh bruh i thought that replaced that method with this one but it does it the other way around

#

thanks

inner mulch
#

is the Y in f3 the location im on or in my feet?

rotund ravine
#

it's ur location

#

but it is also the place ur feet is at

inner mulch
#

so the block below me?

rotund ravine
#

Well

#

Below ur eyeheight yes

sand spire
rotund ravine
#

But not below ur feet

rotund ravine
#

Read up on what super does

sand spire
#

alright I was scared i had to overwrite the 100 methods to make the zombie function normally

inner mulch
#

jan

#

i ran into an issue 😔

#

i can trace the block that above the player head with player.getY + eyelocationY. I want the air block tho the player looks at, at the x and z of the anchor block

rotund ravine
#

Get the player direction

#

and do some math

#

like a fake raytrace

inner mulch
#

noo its my biggest enemey

#

what even is direction 😔

inner mulch
#

fluid == air?

#

does this print true jan

#

for spigot

rotund ravine
#

what

young knoll
#

Fluid is not air

#

Cuz yknow

#

It’s a fluid

inner mulch
#

i feel like raytrace is overkill for this, i have x and z and just need the y the player looks at, at x and z

young knoll
#

The only 2 fluids in minecraft atm are water and lava, neither of which are air

wicked pendant
#

Hey!
I'm coding a custom plugin for my Practice server, however while trying to prevent explosions from destroying white stained glass, I got it mostly working, but only half of the glass gets saved from the explosion, and the other half still gets blown up.
The code is the most basic way of doing this:

@EventHandler
public void onEntityExplode(EntityExplodeEvent event) {
    for (Block block : event.blockList()) {
        if (block.getType() == Material.WHITE_STAINED_GLASS) {
            event.blockList().remove(block);
        }
    }
}
#

Anybody aware of how can I fix this issue?

young knoll
#

Isn’t that gonna throw a concurrent modification exception

rotund ravine
#

probably

wicked pendant
young knoll
#

The heck kinda list is that event using

#

Anyway, try removeIf

merry cove
#

am a bit curious. made my own grappling hook system, and don't see a good way of handling fall damage negated only when used the grappling hook and not have an abusive way of using it ?

#

I tried hooking the cooldown system to it, but if the cooldown is lower than the leap it's a bit redundant

wicked pendant
young knoll
#

event.blockList().removeIf(predicate)

wicked pendant
#

Oh. alright

#

gimme a sec

#

Yep. Thats works perfect.
Thanks!

stiff sonnet
#

is there a hook that gets called when water flushes away block like redstone? I'd have expected the blockBreakEvent to be called there, but that doesn't seem to be the case

young knoll
#

BlockFromToEvent