#help-development

1 messages Ā· Page 1241 of 1

thorn crypt
#

Thank you !

#

is it normal that I can do getAge() but not getMaximumAge ? šŸ¤”
"Cannot resolve method 'getMaximumAge' in 'Ageable'"

Ageable ageable = (Ageable) blockData;
int age = ageable.getAge(); // works
int maxAge = ageable.getMaximumAge(); // do not works
chrome beacon
thorn crypt
fair rock
#

Where didnt see it, can you make it a bit more obvious? xD

blazing ocean
#

there you go

fair rock
#

HAHAHAHAHAHAH XD

#

Where did MrBeast and Subway Surfer came from

quaint mantle
#

Is it possible to send a message to player if they are offline?

#

Saving it to a hashmap or something?

blazing ocean
#

I mean who is it gonna get sent to if they're not online

quaint mantle
unborn kiln
#

You could just save the message to a hashmap to queue it up, wait for a player join, when they join you can send the message. I feel like there's usually a bigger purpose though and 100% a better way to tie it into the system that would execute it

chrome beacon
#

Yeah I don't recommend using a hashmap if you plan on storing that message for long

#

Save it to an SQLite db or smth

quaint mantle
#

When a player joins the server, save their data (UUID) to a YAML file. Check if they are online or offline. If they are online, send them the message. If they are offline, save their uuid to the YAML and then send the message to the player when they logon?

unborn kiln
#

I assume that for any hardcoded message that needs to be sent to a player, it would be sent relatively soon. Otherwise an action or execution can be queued up differently

unborn kiln
quaint mantle
#

Time to watch another kody simpson video khajiit

tidal fog
#

how would i go about detecting if there is a structure at specific coordinates? since im assuming nesting if statments isnt the best way to do this

slender elbow
tidal fog
#

wouldnt be made naturally

slender elbow
#

well, it really depends on what you consider to be a "structure" then

#

is a single block of cobblestone a structure?

#

is a dirt hut?

tidal fog
#

i mean its a specific build im gonna be checking for when a mob dies

eternal oxide
#

You need some way to define the Size/location of the structure

#

As Emily said, is a single block placed by a player a structure?

tidal fog
#

no i would be checking for lets say a 3x3x3 cobblestone cube

#

it would always be the same

eternal oxide
#

If you have to search for it within a specific range then use Chunksnapshot

#

do it Async

tidal fog
eternal oxide
#

if you know the coords then yes just a nested for loop

tidal fog
#

like when a mob dies (so some event listener) check for the cube right under it

eternal oxide
#

if its a 3x3 its a bit harder as the mob could have been on any of the top 9 blocks

tidal fog
#

just the middle block

eternal oxide
#

just the middle, then yes a simple nested for loop

tidal fog
#

so like just if(mob.y-1 == cobble && etc etc)?

eternal oxide
#

if its always going ot be in teh middle one java for(x... { for(y... { for(z... { }}}

#

as you need to check all 27 blocks

tidal fog
#

alr thanks, just for my curiosity is there some library for this? like if the 'structure' was huge

#

and out of different blocks

eternal oxide
#

then I'd say use teh Structure API as Emily also suggested

#

a Structure has a boundingbox you can check if you are within

true wind
#

Is there a way to detect if a player presses the L key and not have the advancements screen open?

#

I used protocollib but it only lasted for a millisecond because I closed all the screens

chrome beacon
#

You can't prevent it from opening

#

You can only close it

tranquil pecan
#

How do i set head texture in 1.21 (spigot) my old code throws error

    public static ItemStack setTexture(ItemStack skull, String texture) {
        if (skull == null || texture == null || texture.isEmpty()) return skull;
        if (skull.getType() != Material.PLAYER_HEAD) return skull;

        SkullMeta meta = (SkullMeta) skull.getItemMeta();
        if (meta == null) return skull;

        GameProfile profile = new GameProfile(UUID.randomUUID(), null);
        profile.getProperties().put("textures", new Property("textures", texture));

        try {
            Field profileField = meta.getClass().getDeclaredField("profile");
            profileField.setAccessible(true);
            profileField.set(meta, profile);
        } catch (NoSuchFieldException | IllegalAccessException e) {
            e.printStackTrace();
        }

        skull.setItemMeta(meta);
        return skull;
    }```

https://paste.md-5.net/abizibaboh.cs
slender elbow
#

use the profile api

tranquil pecan
#

But it needs paper api

slender elbow
#

no?

chrome beacon
# tranquil pecan But it needs paper api

Spigot 1.18.1 added the new PlayerProfiles class, which finally allows us to use custom heads without needing any reflection! You can obtain them as normal items, or actually place them down into the world. I’ll show you how both works: Creating a new PlayerProfile First, we gotta create a new PlayerProfile object. To do so,...

slender elbow
#

spigot has a functional profile api

tranquil pecan
#

oh ok

#

that will work

#

thanks

upper hazel
#

I will be doing a command system on anotations advise me on the way. Manual registration vs reflection

#

what better use

blazing ocean
#

I made an annotation processor that creates a delegate Command impl for my commands and registers them to a service

upper hazel
#

so you use reflection?

blazing ocean
#

well I use service loaders, which would qualify as reflection ig

polar forge
#

hey guys, whats the best way to store data about broken/placed blocks by players?

upper hazel
#

I'm asking specifically about the part where subcommands will be registered in the commandExecutor impl

blazing ocean
#

what

upper hazel
#

subcommands

blazing ocean
#

right what about them

polar forge
#

subcommands like /lp user meta

upper hazel
#

yea

storm edge
#

Does anybody know how to create a item, that works like creative items, but In surival( Infinity uses). For example: A bonemeal, that you can place infinitely in surival?

blazing ocean
#

right what about them

upper hazel
storm edge
# polar forge can u explain more?

So if I use a comment, I get an item with mending 10 or something and I I place it in surival, it should come back, that you can place it again and this infinitely

upper hazel
#

registration process

#

not executing

#

process

remote swallow
#

do whatever you prefer

upper hazel
#

this plugin will be for people

#

i want find better choice

#

this will be mvc controller commands

#

but if this not metter i choice classic option

#

and use system like bukkit event handlers

remote swallow
#

do what ever you feel like you would want and use that

blazing ocean
#

I just like ```kt
@AutoRegistered
public val TestCommand: Command = Command("test") {
executor { sendMessage(text("Hi!!!")) }

sub("one") {
val id by arg("id", stringParser())

playerExecutor { _ ->
  sendMessage(text("id: $id"))
}

}

sub("two") {
val num by arg("number", integerParser())

executor {
  sendMessage(text("number: $num"))
}

sub("three") {
  executor { sendMessage(text("omg: $num")) }
}

}
}

young knoll
#

You’d have to use events to prevent its consumption/give it back after each use

quaint mantle
#

?paste

undone axleBOT
polar forge
#

hey guys

#

So, i installed MySQL on my vds, on which my server is installed

quaint mantle
polar forge
#

there is a plugin which requires a MySQL database

#

so the host is just my domain right?

#

the ip?

#

it asks for host; database; username; password;

quaint mantle
#

Yeah, the machine on which you host the mysql server

polar forge
#

well i used just my domain and it didnt work

#

it says "Host (ip) is not allowed to connect to MySQL"

chrome beacon
polar forge
#

Im using LogBlock btw

chrome beacon
#

Also not sure if shading is a good idea

#

Spigot already contains SQLite

polar forge
#

Any idea why?

chrome beacon
#

connect using localhost

polar forge
#

Ill try

#

it works thx!

quaint mantle
#

Oh, it worked?

#

Thank you Olivo

polar forge
#

yep strange

storm edge
thorn isle
#

what did you try and how did it not work

storm edge
#

I used the BlockPlaceEvent to track the item which i placed, I made a message that appears if the block was placed, and a command to give the item back to the player, but only the message worked and the item wasn’t infinity usable

thorn isle
#

a command?

storm edge
#

I mean a line of code, that gives the player that item that he placed

lost matrix
#

Show us your code and explain what you expect to happen

young knoll
#

Delay it a tick

#

That’s my guess

storm edge
lost matrix
#

Simply increasing the stack size by one within the event should work just fine

#
@EventHandler(ignoreCancelled=true)
public void onPlace(BlockPlaceEvent event) {
  ItemStack item = event.getItemInHand();
  item.setAmount(item.getAmount() + 1);
}
storm edge
#

The amount will stay at 1 item? During the event

rotund ravine
#

He means to increase it by 1 so when 1 is subtracted due to placement 1 is still left

quaint mantle
#

1 - 1 = 1

storm edge
#

Okay, I wil try that tomorrow, thank you guys

lost matrix
rotund ravine
#

Bad alda

chrome beacon
eternal oxide
lost matrix
lost matrix
young knoll
#

Don’t throw your wife

eternal oxide
storm edge
lost matrix
lost matrix
echo basalt
lost matrix
#

My class is sealed

summer scroll
#

How can I give myself an item with custom model data on 1.21.4?
I know that on newer version, it's using custom model data components but is it possible to use the old way? Like similar to /give @a netherite_sword{CustomModelData:1}

slender elbow
#

tbh you should be using item models now

#

e.g. /give @s stick{item_model="minecraft:iron_sword"}

#

just, the model can be anything if you provide it in a resource pack

summer scroll
#

What if I want to add support from 1.20 for example?

slender elbow
#

well the resource pack is gonna be different anyway as the format has changed

young knoll
#

Woo pack overlays

slender elbow
#

at best what you can do is keep using the setCustomModelData(Integer) method

#

and work your updated resource pack around the updated format for that too

#

it's just pain

summer scroll
#

It's a pain I agree

#

But there's no way to give item with texture using custom model data number on 1.21.4?

young knoll
#

There is

slender elbow
#

the format has changed, there is no "old way"

young knoll
#

I believe it’s using the integer value in custom model data

slender elbow
#

custom model data now is a list of floats, colors, and some other stuff

summer scroll
slender elbow
#

the int would just be the first float in the list of floats

#

custom_model_data={floats:[1.0f]}

#

old cmd has effectively been replaced with item_model, new cmd works differently

young knoll
#

Ah there’s only floats not ints

slender elbow
#

floats, flags, strings, colors

summer scroll
summer scroll
slender elbow
#

but the way resource packs work around cmd is just different

young knoll
#

That’s why you use a pack overlay

#

Or just have 2 separate packs

slender elbow
#

god damn AMD and their servers that don't work

chrome beacon
#

hm? What's wrong?

slender elbow
#

can't launch game because requires driver update
can't update driver because amd download server is down

#

truly the most desperate of situations

#

this is most saddening

young knoll
#

How long has it been since you’ve updated drivers 0_o

slender elbow
#

idk

summer scroll
#

When was the custom model data become components, is it 1.21.3 or 1.21.2?

slender elbow
#

.4

slender elbow
#

pft

young knoll
#

What game smh

slender elbow
#

GTA V :intjfall:

#

I damn Rockstar, but God may damn AMD

young knoll
#

GTA infinite, because the next game never comes out

#

Just like the elder scrolls infinite

slender elbow
#

The V in GTA V was originally indicative of how many times they would release the game

young knoll
#

I assume that applies to the elder scrolls V as well

chrome beacon
#

Did you reload the pom

tranquil glen
#

Oh yeah that fixed it, I forgot to delete this

tranquil glen
robust saffron
#

Could someone point me in the right direction for correctly setting up NMS in eclipse? More specifically, is there a way I can add com.mojang.authlib to the project build path without maven? Are there any jar files built from BuildTools.jar that comes with the package?

sly topaz
#

is there a specific reason you don't want to use maven/gradle

#

because you ultimately should, it may be confusing at the beginning but you'll get the hang of it fast

robust saffron
#

Ngl, I'm just stuck in my ways. Is maven/gradle the only option?

sly topaz
#

not the only option, just the easiest

#

if you want to have NMS without a build system, you can probably take the server jar from the cache folder after running it once and use that

#

you won't have all the niceties like mojang mappings though so it'll be a bit rougher to work with

wise zenith
#

Trying to remap a spigot server for NMS development purposes (1.20.4).
java -jar SpecialSource.jar -m 1.20.4.txt -i paper-1.20.4.jar -o result.jar -live -reverse
Everything seems to work fine, but the output jar isn't remapped (or is but only partially). What can be the reason?

sly topaz
#

that isn't spigot but paper

#

they have a completely different remapping system, you should use theirs for their jars

wise zenith
#

Isn't the NMS mapping same for them

#

Otherwise NMS plugins wouldn't work for both spigot and paper at the same time

sly topaz
#

not quite, no

#

paper remaps things at runtime to keep them working when using spigot mappings

#

to begin with, the paper jar isn't even a minecraft server jar but a bootstrap so it wouldn't be the thing you want to be remapping

wise zenith
#

That's not the server jar itself

#

Decompiled

#

That's the library that goes in server/libraries and has both bukkit and nms stuff

sly topaz
#

that's the right jar, but I don't believe it'll just work if you pass it through special source

wise zenith
#

Normally I reference it and manually write NMS code pre-obfuscated but that's really messy and time comsuming

#

So

sly topaz
#

is there a particular reason you aren't just using paperweight

#

it should work just fine for 1.20.4

wise zenith
#

Not very familiar with it, let me check

sullen marlin
#

?whereami

sullen marlin
#

?nms

wise zenith
#

But can it be configured to remap for multiple versions at once

#

Like If I have an interface for each version 1.20.4, 1.20.5, etc

carmine mica
#

need separate modules pretty sure

orchid brook
#

Why when i connect to the server the chunk where i'am is triggered 2 time in the ChunkLoad event?

mortal vortex
#

chat, imagine you're dealing with a language which, in essence is Java 7. Except String isnt actually java.util.String, but rather that with all the methods removed (except for length), so no; String.charAt(), String.getBytes, etc.

With that in mind, how could I convert a string to a char array?

blazing ocean
#

doesn't String impl CharSequence or something

eternal oxide
#

if you have no methods other than length you can't unless the language has some kind of pointers

blazing ocean
#

what language anyway

wise zenith
mortal vortex
#

wait good point lemme see

wise zenith
#

If so, just iterate over it and copy to a char array

mortal vortex
#

Nope

mortal vortex
blazing ocean
#

why not just use jagell

#

jshell

#

cannot fucking type

mortal vortex
#

I didnt have a choice?

#

This is how they have String defined.

blazing ocean
#

do they just not have the stdlib or what

mortal vortex
#

no

#

its being interpreted

blazing ocean
#

why do you even need to use this anyway

mortal vortex
#

thats all I'll say.

#

so limited

blazing ocean
#

oh god

mortal vortex
#

here's what the author said:

Believe it or not but it's built with ReactJS and Typescript. Not a line in Java. I built a custom compiler from Java to Javascript based on JavaAST. As a result we do not support full Java 8 specification but a pretty big part of it.

So yeah, its actually not java at all.

blazing ocean
#

totally not cursed at all

sly topaz
#

because that isn't a string if it only has a length field

#

I guess if you are to be parsing a contiguous memory segment, it could be a thing, but that would only be the case under constraints like char size not being an issue

mortal vortex
sly topaz
#

how is char defined

#

given String is just a length field, creating a char array would essentially be just creating a slice from start of the currently read memory segment to the String's length field

jagged thicket
pseudo hazel
#

thats clearly the biggest crime of all

upper hazel
#

I was wondering why we need a Listener interface for event listeners? It doesn't have any methods or fields it can pass. And needless to say, it guarantees that the class has @EventHandler anotations etc. The class is registered manually, not automatically.

rotund ravine
#

Meh

#

Just for something specific to pass to the method

upper hazel
#

what specific ?

ivory sleet
upper hazel
#

lol

ivory sleet
#

Like RandomAccess or CompletableFuture.AsynchronousCompletionTask

upper hazel
#

for beauty, huh?

ivory sleet
#

Na not really

upper hazel
#

I can't find any other explanation

#

There's no guarantees, so there's no point.

ivory sleet
#

That’s weird, I seem to find quite rigorous explanations on the Javadoc page for example

upper hazel
ivory sleet
#

No I meant the built in ones

upper hazel
#

can you give scrinshoot ?

#

or text

mortal vortex
sly topaz
#

it tells the developer the class contains event handlers

upper hazel
sly topaz
#

by making it a requirement on the registration

upper hazel
#

how such a requirement guarantees that the class contains @EventHandler methods and anotations

#

no need to talk about the visual aspect

sly topaz
#

it doesn't guarante that the class contains event handlers, it guarantees that its intention is to have them

upper hazel
#

so this just visual aspect

sly topaz
#

no, because you can act on that intent

upper hazel
upper hazel
sly topaz
#

i.e., if it doesn't have event handlers, the registration system can decide to throw an exception to tell you there is no event handlers

upper hazel
#

do you know what the word ā€œguaranteeā€ means?

sly topaz
#

let me ask you the same question, do you know?

#

the guarantee is on the intent of the developer, it tells the registration system that the class is meant to be used for a certain purpose

#

without it, you could just pass any class to the registration system, and it can't know for sure what you want to do with it

upper hazel
#

guarantee means that the result will always be what you expect to see, not an obligation to act.

#

I'm asking about the practicality of this interface

sly topaz
upper hazel
#

Well, then the word has several definitions

sly topaz
#

a guarantee is an assurance that certain intent will be held, however that doesn't imply the result willl be the same even if these guarantees are held, as it doesn't consider side-effects

sly topaz
#

i.e., if the top class is annotated with Listener, then all inner-classes will also be counted for event handlers

#

(that is an example of a behavior that could be decided upon that intent, not necessarily what happens)

upper hazel
#

the law isn't a guarantee then?

sly topaz
#

the law isn't a guarantee, no. Otherwise judges wouldn't be needed

upper hazel
#

Programmers strive to minimize the risk of errors in a program. The only purpose of an interface that I see is simply to warn the developer who is trying to create an event listener or just to visually indicate what kind of class it is.

#

If that's called a warranty, I don't know what to say.

sly topaz
#

I think you are misunderstanding who the interface is useful for

#

the interface serves little use to a plugin developer, as they only have the obligation to use it. The only practical use a plugin developer could find is that where they are developing a framework around the event system and implementing automatic event registration, as it helps to discard classes which are well, not listeners

#

the practicality here is for the registration system, which can make decisions based on the implementation of the interface

upper hazel
sly topaz
#

now, could a different marker than an interface be used? Definitely, given event registration is manual

sly topaz
upper hazel
#

from a profit standpoint, it doesn't make sense

wraith dagger
#

mappings?

#

mappings

#

guys i forgot the bot command mapping

#

what that

#

?mappings

undone axleBOT
wraith dagger
#

oh here

sly topaz
upper hazel
#

like @EventHandler

sly topaz
#

because that isn't enough when anonymous classes, inner classes, method-level classes exist

upper hazel
#

what difference does it make if the registration is manual. It's the developer's fault

sly topaz
#

registration is manual for classes, not for the methods so the line gets blurry

upper hazel
#

and what would that lead to for example?

sly topaz
#

the marker is there for the lack of explicit-ness with the registration, it could have been done differently but this si the way they decided to go about it

upper hazel
#

Okay, I'll take martker as a means of minimizing risk if the warranty isn't what I think it is.

#

but still, it's like it's got multiple definitions.

#

If predictability is minimization, fine. but on a percentage basis, it looks not very good

#

option

#

this is like @NotNull vs @NonNull from lombok

#

but if i want minimize risk i choice lombok

sly topaz
upper hazel
#

i dont think compiler accept it

sly topaz
#

what happens here, does it register both methods since the top-level method has an @EventHandler annotation or or we register the top-level method only

sly topaz
upper hazel
sly topaz
#
public abstract class EventDefiner {
  @EventHandler
  abstract void onEvent(SomeEvent idk);
}
public class SomeOtherClass extends EventDefiner {
  @EventHandler
  public void onEvent(SomeOtherEvent idk) {
    
  }
}

what happens here

#

do I register both events, or only one if I had only passed SomeOtherClass to registerEvent

upper hazel
#

abstact class can impl interface

sly topaz
#

I mean, sure, we could put artificial limitations like not allowing @EventHandler on abstract methods, but this is what I am talking about here when I say it isn't enough

#

with Listener being a thing, the registration doesn't have to make guesses on what exactly the developer intended to do with these, as one would implement Listener and the other wouldn't

#

not necessarily what happens in real-life, as Listener doesn't get used as exhaustively of a check, but you get the point

upper hazel
#

wait, this example is not accurate because manual registration will forward the class object.

ivory sleet
#

At the end of the day, I doubt it’d have mattered much if we could just pass any object to a bukkit event executor as the ā€œlistenerā€

#

Like it really isn’t that deep, its a design choice that was made like what now? 10 years ago almost if not even more

upper hazel
#

marker will not give protection against such a problem

upper hazel
sly topaz
ivory sleet
#

I mean if you wanna havoc your own code so be it, worse comes to worst you can just retrieve the unsafe instance and fuck up whatever you want

ivory sleet
#

Zero cost abstractions are not a thing (imo)

upper hazel
ivory sleet
#

What is?

upper hazel
#

but it's more trouble than it's worth.

ivory sleet
#

Bro, Serializable has been with us since java 1 literally, it’s the worst example anyone can provide, your argument is flawed

upper hazel
#

lol

ivory sleet
ivory sleet
upper hazel
ivory sleet
#

like in the real world you probably use checkers framework

#

yes really

#

You likely use the null checker from checker’s framework to prove your program’s null safety

ivory sleet
#

No its a different problem, marker is just a marker

#

Checker’s framework add null restricted types etc

slim wigeon
#

I watching a youtube series made by Direwolf20 and from Lets play Season 5 - 1.4.6, there is this item that auto supply when he places a block such as cobblestone. I trying to create that using my portable chests but I don't know how to get the max stack size of a material like cobblestone is 64. I tried the following code and I not seeing anything if( inv.contains(item) && !player.getInventory().contains(new ItemStack(item.getType(),item.getMaxStackSize())) ) { player.sendMessage("Item Added x1"); return; }

ivory sleet
#

Yes there are cases where its used poorly

#

but most of those cases come from design choices back in the days when we didn’t know what was good, when you weren’t a developer even so

ivory sleet
#

But there’s probably some method in Material or ItemType to find the default max stack size I reckon ^^

slim wigeon
#

I don't know what you mean by hidden but I cannot really show you what I mean because I watching it offline. yt-dlp but if you know how I can get the default stack size, that be helpful to make this auto supply

upper hazel
ivory sleet
#

It’s not

#

I mean like don’t get me wrong, there are terrible choices everywhere, in bukkit, in the jdk etc, but its not like we can just flip the switch and change that right now when entire eco systems depend on these suboptimal choices

upper hazel
# ivory sleet It’s not

I mean, some places need antipatterns and some don't, no matter what society calls them. In the case of the markers, people were following a path they knew.

ivory sleet
upper hazel
#

an antipattern is a pattern that harms the architecture as I understand it.

#

so this is why call anti

slim wigeon
ivory sleet
#

Material::getMaxStackSize exists

#

that method also exists on ItemType and ItemStack ^^

#

and even on the scary ItemMeta

slim wigeon
slim wigeon
#

I got another issue. I don't know if its how getMaxStackSize works but when I use +1 or -1 as shown below if( inv.contains(item) && !player.getInventory().contains(new ItemStack(item.getType(),item.getType().getMaxStackSize()+1)) ) { player.sendMessage("Item Added x1"); return; }The code does not really work, any fixes?

jagged thicket
#

are u sure that is possible ?

#

(i don't know what im talking about)

young knoll
#

You probably want containsAtLeast

torn badge
glossy laurel
#

Does that sound right to you?

rotund ravine
#

Why would it be one above the limit

glossy laurel
#

Material#getMaxStackSize+1

rotund ravine
#

Why i ask you

glossy laurel
#

I dont know

rotund ravine
glossy laurel
#

Ask MrnateGeek

rotund ravine
#

Ohh i thought u were the guy

rotund ravine
glossy laurel
glossy laurel
rotund ravine
#

containsAtleast is what he’d want to ignore things like amountleft

#

/ currentstacksize/amount

glossy laurel
#

I guess?

#

But what is he trying to do

#

Check if a player has 2 stacks of an item?

#

And why is the result of the message "Item Added x1"

#

Cuz from what I see it seems like he's trying to modify an item stack in a condition

rotund ravine
#

I think he’s just trying to see if the current amount of said item is not currently full?

#

And that he has atleast one

glossy laurel
slim wigeon
glossy laurel
#

So like a bundle?

#

Or what

slim wigeon
#

Watch the inv

glossy laurel
#

Sure?...

slim wigeon
#

You see what I trying to do now?

glossy laurel
#

Kinda?..

slim wigeon
#

Let me look thru my HDD of direwolf20 showing it in action as well, just for you to compare to my plugin

#

Here is the link: https://youtube.com/watch?v=hM9P5PDS6VA . You have to scroll to at least 25:00 timestamp

Getting moved into a new home, and setting up some IC2 power production and machines

Keep up with my thread here: http://www.minecraftforum.net/topic/1513504-direwolf20s-modded-lets-play-series/
Facebook: http://www.facebook.com/Direwolf20
Follow me on Twitter: https://twitter.com/#!/Direwolf20
Join our IRC channel -- #Direwolf20 on espernet

ā–¶ Play video
slim wigeon
slim wigeon
#

You right, its 12 years ago but it does show what I trying to create

smoky oak
#

is it possible to force-render a particle so that it is visible within entity/simulation distance instead of the 31 blocks particles are normally restricted to? i want to use them as indicators, like a false beacon beam, but projecting them towards players comes with its own issues

#

aka how the hell do i project a particle so a far away player can see it without having parallax issues?

echo basalt
#

wynncraft just uses croppy ass beacons for that

#

what about using a really stretched out display entity

slim wigeon
#

About wynncraft, I wish I know how their waypoint system works

slender elbow
#

doesn't the force parameter work?

eternal oxide
#

abuse perspective. render closer but smaller to indicate the path

noble current
#

anyone know how custom model data works in 1.21+?

#

in code

smoky anchor
#

Use the new model component instead for simple models

noble current
smoky anchor
#

in the future, speficy even the dot release
these things now change really often

#

1.21.4 has many more features than 1.21.1

noble current
#

thanks you

noble current
#

but im using custom_model_data

#

it isnt possible to use?

smoky anchor
#

What are you trying to use the custom model data for

noble current
#

custom texture items

smoky anchor
#

Yes, the better way is what I linked

noble current
#

i don't know how to use it on item model

smoky anchor
#

It does not need to replace any item models/textures.

#

And even if you wanted to use CMD you'd have to change the item model definition.
There have been changes, look up how to make RP on wiki or ask for help in the Minecraft Commands Discord server.

noble current
#

okay

#

but for custom model data i need to use custom model data component?

smoky anchor
#

Correct, you'd have to do that.

noble current
#

import org.bukkit.inventory.CustomModelDataComponent;

this is correct?

smoky anchor
#

But again, for simple models (retextures) use the item model component.

smoky anchor
noble current
#

i can't find it

smoky anchor
#

well the one I sent

#

you can get from there to the right one

noble current
#

sorry im new

#

i can't find the import

smoky anchor
#

Do you know how to navigate docs ?

#

You click the blue link

#

it tells you stuff

noble current
#

oh sorry

#

i didn't knew

smoky anchor
#

What matters is that you learn this :)

noble current
smoky anchor
#

no, the Package shows only the package.

#

You need to put the class there as well

noble current
#

oh

smoky anchor
#

org.bukkit.inventory.meta.components.CustomModelDataComponent

noble current
#

my hero

smoky anchor
#

Eclipse ?
In any case, IDE should autoimport that for you...

noble current
smoky anchor
#

No

#

If that is the case then throw away that IDE, get IntelliJ
Or possibly correctly setup your project
Or idk, but you should not have to manually write imports...

#

Does your Eclipse not have any intellisense ?

noble current
smoky anchor
storm edge
#

Is anyone German, knowledgeable about coding and have a little time?

blazing ocean
#

steve are you an eclipse user

smoky anchor
smoky anchor
undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

noble current
#

how i can instantiate the custom model data component?

smoky anchor
#

I told you, get it from ItemMeta

#

Read what the docs I sent say

noble current
#

it is too hard

#

🪦

smoky oak
noble current
slender elbow
#

get it from the ItemMeta with the getCustomModelDataComponent() method

#

then, you can use the setFloats/Flags/Strings/Colors methods
and then, you use setCustomModelDataComponent on ItemMeta to set it back

tender shard
slender elbow
#

itemmeta api

noble current
slender elbow
#

what kind of errors? what's your code look like?

noble current
#

like how i need to instantiate it from the item meta?

slender elbow
#

itemMeta.getCustomModelDataComponent()

#

and put it in a variable

tender shard
#

you use the existing one

smoky anchor
#

Do you know how to get itemMeta?

slender elbow
#

I'm not really sure what the issue is

#

You said you keep getting errors, what errors? what does your code look like?

blazing ocean
#

secret

tender shard
#

it no work

blazing ocean
#

alex help it no worky

tender shard
blazing ocean
#

thanks it worky now

tender shard
#

?learnjava

undone axleBOT
#

For Beginners:

Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/

For Intermediate to Advanced Learners:

Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/

Practice and Hands-on Learning:

Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/

Free Resources and Documentation:

Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/

Community and Support:

Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/

Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! šŸŽ‰

noble current
#

https://cdn.discordapp.com/emojis/586966443539562604.gif?v=1?comment=CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO-CHANCHO-CULIADO

slender elbow
#

you need to put it in a variable

#

then modify that CMDC variable

#

and then call ItemMeta setCMDC using that same modified variable

noble current
slender elbow
#

jetbrains academy is a great resource for learning basic java

noble current
orchid brook
#

Why is the "chunkload" event triggered twice for the chunk where I connect to the server?

orchid brook
#

yeah i log in the console all chunk that is loaded when i conect to the server and I just noticed that the chunk I am in when connecting is triggered twice by the "chunkload" event.

noble current
#

i stored the itemMeta.getCustomModelDataComponent() in a variable

#

but how i modify it

#

i mean, with what function

tender shard
slender elbow
#

it has methods like setFloats, setFlags, setStrings, setColors

noble current
#

yes i saw but

chrome beacon
#

Yeah that tells you what's wrong

orchid brook
slender elbow
#

it takes a List of Strings, List<String>

#

not a single string

noble current
#

@slender elbow

#

this is good?

tender shard
#

yes

noble current
#

thanks, ill try it

#

šŸ™

quaint mantle
#

Am I supposed to use List<String> lore = new Array<>();
For itemlore?

blazing ocean
#

I don't think an array is a list

quaint mantle
blazing ocean
#

correct

quaint mantle
tender shard
#

usually if sth needs a List<...>, and you don't have any reason to use sth else, you'd use an ArrayList, yes

restive mulch
#

sigma

outer tendon
#

Im building a BlockPopulator for a world in which I would like to generate terrain based on the way Minecraft generates its terrain for nether worlds. However, I am adding this BlockPopulataor to the BlockPopulator list for an overworld world. I want to copy nether generation under a certain y-level.

My current way of doing this was to get block data from a nether world in my populate method, but unfortunately, that is not thread safe, and it caused a lot of issues, so I'm looking for a more ideal and thread safe way of doing this.

chrome beacon
#

hm? are you trying to do world gen in the block populator?

#

They're only intended for smaller amounts of blocks

magic beacon
#

Whats the correct code for this?

blazing ocean
#

I mean we have zero context here

slender elbow
#

for all we know the correct code is to delete that line

glad prawn
outer tendon
#

I could use a ChunkGenerator, but I still don't know how I would go about this

polar forge
#

I fugged up

#

A question

#

Why does this command remove hearts instead of healing me?

#

I know setMaxHealt() is deprecated but I've read online that it still functions

eternal oxide
#

all you are doing is setting max health. You do no healing

orchid brook
polar forge
eternal oxide
#

max health is just the MAX you can have

#

health is how much you have

polar forge
#

but i set it to 20

#

why do i get random digits?

eternal oxide
#

you are only setting the MAX

polar forge
#

How do i heal someone then

eternal oxide
#

I just showed you

polar forge
#

setHealth()?

eternal oxide
#

yes

polar forge
#

so setHealth(0, 20)?

eternal oxide
#

just 20.0

polar forge
#

and another question

eternal oxide
#

or setHealth(player.getMaxHealth())

chrome beacon
#

Just need to jump back to the main thread to get blocks

#

Since that's not thread safe

eternal oxide
#

you should actually use Attributes to get teh true max health

polar forge
#

yes thats what i did

#

at the beginning

#

but i also had the same problem

#

Btw Ive also made another plugin

#

WarpPlugin

#

but idk why i receive a strange error

#

aboyt PluginOptimalization idk

#

something like that

#

^ FreezeCommand

#

^ FreezeListener

#

This plugin must freeze a player when an Op does /freeze <player>

#

when i do it i receive the message, but it doesnt do anything to the affected player

eternal oxide
#

the || in the listener is pointless

#

just compare teh from/to block

polar forge
#

how do i compare

eternal oxide
#

== as its an instance

polar forge
#

so

eternal oxide
#

if (getFrom().getBlock() != getTo().getBlock())

thorn isle
#

Is it the same instance?

eternal oxide
#

teleport the player to their getFrom

#

he only needs to compare if the block instance is different and teleport them to their from location

polar forge
#

yes but i have 2 if statements that i would need to do if i remove the ||

eternal oxide
#

no you woudl not, compare BLOCK not x/z

#
if (e.getFrom().getBlock() != e.getTo().getBlock()) {
    e.getPlayer().teleport(e.getFrom());
}```
polar forge
#

Top Ill try it out

#

and another thing

#

^ Feed Command

#

why do i get an External error?

#

You know the red error

eternal oxide
#

what error?

polar forge
#

after i send the command, i still get fed but i then receive a red error

#

An Exceptional

#

something like that

eternal oxide
#

fed?

#

you posted the freeze command

polar forge
#

yes

#

Yes thats solved

#

There is another thing

polar forge
#

^ ^ FeedCommand

eternal oxide
#

that is not a feed command

polar forge
#

Opsie

remote swallow
#

if args is 0, use arg 0?

eternal oxide
#

if you return false the server will display an error

#

that also ^

polar forge
#

args[0] is just /feed

eternal oxide
#

no

#

command is feed

remote swallow
#

sounds like your command setup is broken if the arg is the command

eternal oxide
#

arg 0 would be feed if you typed /feed feed

polar forge
#

/feed is just args[0] right?

remote swallow
#

no

#

feed is the label

#

which you called s

outer tendon
polar forge
#

but why then if i wrote /ban then its just args[0]?

outer tendon
#

Im curious if there's a more ideal way of doing it than jumping back

remote swallow
#

/command i am an arg

the string is command
args is [i, am, an, arg]

outer tendon
#

because Idk how to do that

remote swallow
eternal oxide
#

in your ban arg 0 is the p[layer you want to ban

polar forge
#
If (args.lenght == 0) {
sender.sendMesssage("Specify a Player")
}```
remote swallow
#

you probably want to look at your indents too

polar forge
#

then this just means the player is just submitting a command like /ban

remote swallow
#

correct

polar forge
#

then args[0] is just the command

remote swallow
#

args being 0, means its just the command

remote swallow
polar forge
#

u just said that

orchid brook
#

Anyone have an idear why the chunk where i connect get loaded -> unloaded and then loaded back ?

polar forge
#

u said the same thing i said

remote swallow
#

no i didnt

#

no args = /command

#

args = /command arg

eternal oxide
#

he did kinda but yoiu mis understood

#

he means arg length of 0

remote swallow
#

by "just the command" i mean literally only /command

polar forge
#

yes thats what i also mean

remote swallow
#

example again

/command argument

args length is 1, and args[0] = argument

eternal oxide
#

arg length of zero means there are no args. the array is empty

chrome beacon
polar forge
#

so should i change it to 1?

chrome beacon
#

?scheduling

undone axleBOT
remote swallow
#

you need to look at where you have your code to see whats running for what cause

outer tendon
slender elbow
#

a scheduler to jump? like a skipping rope with a metronome?

blazing ocean
#

on a trampoline

outer tendon
#

bruh

chrome beacon
#

but you can take a look at how the world gen works and see if there's a suitible place to modify it to work how you want it

outer tendon
#

I did, and it looks like it would be extremely difficult to do

#

I wish I could just have it run its generator as if it was making a nether world after it does the same for a

#

wait a minute

#

nah that wouldnt work nvm

thorn isle
#

If the populator works other than being thread safe, you should be able to just synchronize to main and block like lmdll suggested

#

Yes a blockpopulator will behave somewhat poorly vs a proper chunk generator, but it should be tolerable

vagrant hornet
#

hey, do someone know how to use custom model data for mobs, and where to find models ?

chrome beacon
#

Mobs do not support custom model data

#

at least in vanilla*

vagrant hornet
chrome beacon
#

There are a couple tricks that can be used to get around that such as using Display Entities or Armor stands to show items with models

vagrant hornet
#

okay, do you have any ressources on how to do that ?

chrome beacon
#

Which part? Making models?

solid vale
#

@vagrant hornet welcome to the server šŸ™‚

vagrant hornet
vagrant hornet
chrome beacon
#

To set the item model of an ItemStack (from it's ItemMeta) get the CustomModelDataComponent

#

and then set one of it's values so it corresponds to the model you want

vagrant hornet
#

this i know, but i talked about mobs x)

chrome beacon
#

I mean you quite literally just put the item in the hand of an armor stand

#

or just set the item stack of the Display Entity

torn badge
#

With Display Entities being the much better choice btw

bold nebula
#

It's possible to detect holding left click?

chrome beacon
#

You can assume they're holding left click if they're mining a block

#

Other than that not really

bold nebula
#

Uhm.. it would work in adventure mode?

chrome beacon
#

Not really since the player isn't breaking any blocks in adventure mode

bold nebula
#

ik

chrome beacon
#

Unless you have an item that can do so ofc*

bold nebula
#

you can mine blocks in adventure mode with item that has nbt or something?

sullen marlin
bold nebula
#

Oh really?

sullen marlin
#

look at that stuff, pretty elite

bold nebula
slender elbow
#

or, looking downwards

jade oasis
#

Does someone got the litebans api cause I’m tryna make a punishment GUI so when clicking something in a GUI it runs a command but goes down an offence scale but don’t know fully what I need so yh any help would be appreciated

slender elbow
jade oasis
torn shuttle
#

crazy

#

the guy who made that must be really smart, and sexy too

bold nebula
#

I want to detect hold left click and the only way is to increase the player reach to like 100 and make sure there are barriers around the map so the player is always mining a block but what if the player target is an entity?

chrome beacon
#

Not much you can do except place a block closer than that entity

orchid brook
#

How can i trace a line between 2 BlockDisplay ?

chrome beacon
#

Depends on what you want to do with said line

orchid brook
#

just for debug purpose

chrome beacon
#

That doesn't really explain anything

#

Do you want to show a line of particles?

orchid brook
#

Can i send u a screenshot of what i try to do ?

blazing ocean
#

?img

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

orchid brook
#

because its not particle i think

#

something like this (the green line)

chrome beacon
#

Those are just block displays

orchid brook
#

oh okay

chrome beacon
#

What looks to be diamond and emerald blocks repeated

#

scaled and rotated ofc

bold nebula
thorn isle
#

if it isn't a big issue to switch the key, you can pretty easily tell whether right mouse button is held or not, since it will send a packet every tick it's held

#

left mouse is much harder

bold nebula
#

I would like to use left click because im making guns

#

and left click is for shooting

#

If i can't detect hold left click then i need to press left click everytime when i want to shoot

thorn isle
#

swap it around so right click is shooting

#

because i don't think the 'put fake blocks in front of entities' thing is going to work out

#

at least not very reliably

chrome beacon
#

Also yeah just use right click for shooting?

#

Pretty much every server has the buttons flipped anyways

bold nebula
#

nope, i saw few servers that use left click for shoot

thorn isle
#

paper has Player::sendBlockChange for super easy fake blocks

#

but the problem is figuring out where to place them

chrome beacon
#

Spigot has that too

#

problem is they go away when interacted with

#

So you need to handle that packet yourself

thorn isle
#

you'd not only have to ray trace the player's line of sight every tick and cover any entities with fake blocks, but also predict player movement and pre-emptively cover entities with fake blocks

bold nebula
#

too much work

thorn isle
#

and since this is a combat "muh pvp" situation, any inconsistency in this (single-fire because the block packet arrived too late, instead of burst) is going to result in butthurt

#

so i'd just go with rightclicks

thorn isle
#

i don't see the 'targeted block' highlight that appears when a block is within reach distance on those quartz blocks

#

they might be doing something else

chrome beacon
#

That's removable

#

with a core shader

#

which they are using for those animations

#

not the same shader*

thorn isle
#

i think those animations should also be doable with display entities and billboarding

chrome beacon
#

could be

#

that map is a core shader though

thorn isle
#

yeah those animations don't look like display entities either, but i think something similar could be done with them

#

idk i think using shaders for "no mods" things is kind of cheating imo

chrome beacon
#

They are very powerful

#

Also break real quick with mods installed

bold nebula
#

I wonder if they used entity or a block at this point

clear elm
#

how can i muke such holograms

eternal oxide
#

Displays

clear elm
#

is it a new entity?

eternal oxide
#

recently new

#

Text, Item and Block

clear elm
#

alr thanks

worldly ingot
#

One that totally encompasses the player

#

Unsure if you can have it ride the player, but if you can, that probably makes it way smoother and doesn't require teleportation packets

thorn isle
#

is that going to work for left clicks?

chrome beacon
#

Hm can they do left clicks?

worldly ingot
#

Yes? Doesn't it handle both?

#

Yes, it handles both

thorn isle
#

🤔 i think i'm out of date

#

what's an interaction entity

worldly ingot
#

Literally just an invisible entity with arbitrary size that listens for left and right clicks

chrome beacon
#

Not just a single click

worldly ingot
#

That video sent above doesn't hold it down

thorn isle
#

but that's not gonna have the player reporting the button being held down, is it?

worldly ingot
#

It single clicks to zoom

#

Oh I guess it holds to shoot. Not sure

thorn isle
#

i'm pretty sure it does but i can't find the timestamp for it now

young knoll
#

Can’t you use the Input system to detect if left click is held

#

Ah no that only has WASD sprint sneak and jump

worldly ingot
#

Interaction entities seem to handle holding down the right mouse button, not the left mouse button. Just tested in game

thorn isle
#

even for right click there isn't really a "button held" and a "button released" event in the protocol, only a "button pressed" one sent every tick

worldly ingot
#

Correct

thorn isle
#

same for left click except the client doesn't resend it every tick

#

except when mining blocks which actually sends start/stop mining packets

#

but that'd involve covering all interactable entities with invisible and non-collidable fake blocks and i'm not sure if that's tenable

worldly ingot
#

WAIT

#

What about the mining distance? eYeS

thorn isle
#

that was the original idea; boost mining distance to say 100 and make sure the skybox is covered with barriers or whatnot

young knoll
#

sadly the max is like

#

64

thorn isle
#

but if an entity steps into your line of sight, you're going to send a "punch that entity" packet instead of "mine that block" packet and it breaks down

#

and you most likely are gonna shoot at entities rather than blocks

worldly ingot
#

The alternative is, yeah, having a fake block at least a couple blocks in front of the player and intercept the block break start packet, then wait for a block break stop packet

young knoll
#

Shame you’d see the block outline

worldly ingot
#

Not in adventure mode

thorn isle
#

supposedly, if the dev's passive aggressive response is to be trusted, that's not how they do it

worldly ingot
#

I don't know if the client will send a stop packet if the block is gone, it might send it when the cursor is let go

thorn isle
#

not sure if the client will send a start mining packet in adventure either

young knoll
#

Will it even send a start packet in adventure mode

worldly ingot
#

I don't know, man! D:

young knoll
#

You work at hypixel!

#

Adventure mode exists in 1.8

worldly ingot
#

YEAH BUT I DON'T KNOW EVERYTHING

young knoll
#

I think

#

THEN UR FIRED

worldly ingot
thorn isle
#

replicate all player and entity models with display entities so there are no entity hitboxes 🤔

#

also replicate all terrain and blocks with block displays so there is no selection outline for them, and have a 60 block diameter barrier sphere follow player around

worldly ingot
#

I can hear the server fans from here

mortal vortex
worldly ingot
#

Bold of you to assume I even have it

sullen marlin
#

Don't let watchdog read your kernel TCP settings tho

mortal vortex
#

Years ago tho trust

worldly ingot
#

Banning rn

mortal vortex
fair rock
#

Imagine telling a hypixel dev how you cheated is a crazy move inflatable

wary mauve
#

I am trying to make it so I can control the speed at which blocks are mined by listening for block damage events and then sendBlockDamage() to the player. But I'm running into the issue of the client's mining making it spazz out between the 1 tick of block damage and what my plugin is trying to simulate.

Am I going about this the right way? Is there a way to stop the 1 tick of block damage from showing while the player is mining?

thorn isle
#

use the tool component

#

of course this only works for custom tools and the like, not mining by hand; but i assume that's what you're trying to do

#

the client going out of sync with the server is inevitable if you don't give it some way to predict the result, and so far the only way to do that is this

wary mauve
sullen marlin
#

getItemMeta getTool set what you want on tool setTool setItemMeta

wary mauve
#

I'm not seeing a org.bukkit.inventory.meta.components package

#

in my ide

thorn isle
#

these were added in 1.21.4; what version are you building against?

wary mauve
#

oh. 1.20.4

thorn isle
#

yeah, no components at all on 1.20

#

1.21 was the component rework and 1.21.4 builds on it to add some more useful ones

wary mauve
#

Idk if y'all remember Cosmic Prisons, but I think they did this mining gimmick that I'm trying to do

#

Is there something else to do for this version?

thorn isle
#

i'd recommend updating to latest since that makes life generally easier, but apart from that, you could maybe apply invisible mining fatigue on the player to stop the breaking animation from progressing on the client end

#

it'll still be kind of janky, but perhaps better

#

this'll also prevent instabreaking blocks as you can e.g. smoothstone with efficiency V and haste, since that relies on clientside predictions that you'll throw out of whack with the mining fatigue

wary mauve
#

so things are updated to 1.21 and I'll be fine upgrading?

thorn isle
#

that depends 100% on your setup

#

my crystal ball is still in the repair shop so i regrettably can't tell what plugins you have to check if they've updated to 1.21.4

#

generally yes, most things have already updated to .4

#

even slimefun which took forever for whatever reason already has a .4 build

slender elbow
#

components were added in 1.20.5

thorn isle
#

i'd only expect major incompatibilities with plugins that are doing hacky nbt things, i.e. have pushed off updating to use pdc for like 10 years

rotund ravine
sly topaz
#

5 I believe you, 10 makes me sad

sullen marlin
#

...

queen fern
#

…

orchid brook
#

Does anyone have an idea of how I can prevent the ChunkLoadEvent from being triggered twice for the chunk I’m in when I connect ?

sullen marlin
#

It shouldn't be being triggered twice unless it's loading twice

#

What's the issue exactly

orchid brook
#

That strange because i have just this:

public void onChunkLoad(ChunkLoadEvent event) {
    Chunk chunk = event.getChunk();
    if(chunk.getX() == -26 && chunk.getZ() == -1) {
        System.out.println("Chunk loaded");
    }
}


public void onChunkUnLoad(ChunkUnloadEvent event) {
    Chunk chunk = event.getChunk();
    if(chunk.getX() == -26 && chunk.getZ() == -1) {
        System.out.println("Chunk unloaded");
    }
}
``` -26 and -1 is the chunk where i connect
and my console print me this: 
[06:48:59 INFO]: [LostEra-Utilitaires] [STDOUT] Chunk loaded
[06:48:59 INFO]: [LostEra-Utilitaires] [STDOUT] Chunk unloaded
[06:48:59 INFO]: [LostEra-Utilitaires] [STDOUT] Chunk loaded
sullen marlin
#

So it's being unloaded

orchid brook
#

That what im trying to understand why its being unloaded ?

sullen marlin
#

probably because the first load is a transient load to get the spawn position or something

#

why does this impact your plugin?

#

is this 1.21.4?

orchid brook
#

When a chunk is loaded, I check if there is a custom collector from my plugin, and if there is, I load the custom collector. However, if I connect to a chunk that has a custom collector, it gets loaded, unloaded (causing it to be saved in the database unnecessarily), and then reloaded again.

eternal night
#

(also sanity check, is this on spigot or on paper)

orchid brook
#

That's not realy an issue, I was just wondering why the chunk is loaded twice for better understand.

sullen marlin
#

I just tested spigot 4457 (latest) and see no unloads

#

what does /version say?

orchid brook
#

Im not using the latest i will try with latest

bold nebula
#

interaction entities will detect if im holding left click?

wide coyote
#

I dont think so but try it and see

jolly cliff
#

I am creating a GUI plugin, and I am using a compass as the item to open the GUI. I have named the compass "Game menu." At the same time, I am also using WorldEdit, but when I click on that compass, WorldEdit activates. I want the Game menu compass to not trigger WorldEdit. How should I write the processing in the GUI plugin to achieve this?

I cannot speak English, so I am using translation.

mortal vortex
#

Would you be willing to disable that feature from WorldEdit?

minor otter
#

I'm attempting to find good keybinds for items and all I know about for possible keybinds are

Space (jump)
F(swap)
Directions (wasd)
Q(drop)
Lmb (interact)
Rmb (interact)
Shift (sneak)
Ctrl (sprint)

#

Anyone know any others?

jolly cliff
#

I would like to be able to use everything in world edit except the compass used to open the GUI, but when I asked about this on the world edit discord, I was told that this is something that needs to be done on the GUI plugin side.

#

Original text

that’s something that the gui plugin would have to do, worldedit wouldn’t be able to do that
the gui plugin needs to listen before worldedit, and cancel the event when it’s intending to handle it
unless the other plugin does that, worldedit has no way to know it’s wanting to show a gui

mortal vortex
#

you can disable that specific thing

jolly cliff
#

Solved. Thank you

glossy laurel
#
Location endLocation = event.getTo();
Location from = event.getFrom();
endLocation.setX(from.getX());
endLocation.setZ(from.getZ());```

I have this in an on move event, but it allows players to move very slowly still. Anyone can explain?
sullen marlin
#

Why not setCancelled

#

Also Y

young knoll
#

Cancelling the event is a bit jittery

#

I prefer setting movement speed and jump strength to 0

sullen marlin
#

Don't think this is better pretty sure it's the same

drowsy helm
#

If you want to cancel movement use potion effects on top of it

glossy laurel
#

i dont want y

#

thats the point

young knoll
#

Then just set movement speed to 0

young knoll
glossy laurel
young knoll
#

Then use the event to check that and change it back to normal

glossy laurel
#

ill try

torn shuttle
#

love having plugin tickets, just really great

#

it keeps going, too

blazing ocean
#

kekw

worldly ingot
#

Just write good code

#

fricken idiot

fair rock
#

Or close all tickets as "Intended Features" šŸ’€

zealous osprey
fair rock
#

I like that idea xD

pseudo hazel
#

I wish my plugin had this much attention

blazing ocean
#

wontfix

pseudo hazel
#

and then when I got it I probably wish it werent so like you do now

worldly ingot
#

I mean VeinMiner is fairly popular but my support server is relatively quiet. The occasional person coming in once a month or so asking how permissions work or their config not working how they expect, and that's about it

#

If you have a fairly straight-forward, out-the-box working plugin that really doesn't need configuration, you're not burdened by support

pseudo hazel
#

yeah fair

worldly ingot
#

Something like Magma's plugins don't really meet that definition I'm afraid KEKW

blazing ocean
#

what if they just wan an exe

pseudo hazel
#

but if its things like minigames or like faction plugin 1246472 then yeah I guess there would be more to support

worldly ingot
#

That's why I gravitated towards simple and easy to understand mechanic plugins

pseudo hazel
#

yeah I wanna make plugins like that too, but I aint got no ideas that havent been done to death yet

pseudo hazel
worldly ingot
#

I mean... I made a vein miner plugin

#

You can make a plugin that's been done before, you just have to do it better

pseudo hazel
#

right thats true

blazing ocean
#

just pull a cmarco

pseudo hazel
#

which is?

blazing ocean
#

say that god wants you to use this plugin šŸ‘

pseudo hazel
#

lmao

#

based

#

I guess i just need ideas of plugins to make then and dont be such a b about it

#

maybe ill ask daddy gpt

blazing ocean
worldly ingot
#

I considered a long time making a firework plugin where you could define custom firework shapes and whatnot. I think there are a few out there that just make images, but none that make animated shapes

#

Ones that actually look like vanilla fireworks

#

Would need to be configurable out the wazoo though so lol

pseudo hazel
#

okay well so I did think about making a particle plugin that just works but turns out java particle system is asinine so its really hard to make anything of value

umbral ridge
#

XD

slender elbow
#

ah, the plugin developer's #1 enemy

#

basic trigonometry

worthy yarrow
#

Go try some physics

#

While you’re at it, write me a frisbee physics lib

wraith dagger
#

guys

#

is there anyway to register existed entity Attbrutes generic attack damage for animal mob like pig?

#

cuz animal mob don't have Attbrutes of generic attack already

#

when i use normal set it just error

kind coral
#

i am making a backend in spring, and i am using postgres and flyway, anyone ever tried using it? i am having a problem where my application never loads because flyway says it is not compatible with any version of postgres when on the documentation it says it is up to latest.

chrome beacon
#

Those mobs don't attack

woeful sleet
#

Subject: Minecraft Developer Needed for XrossHearts

Hey! I’m Hamzacross100, owner of XrossHearts. We’re looking for a passionate Minecraft developer to help with custom plugins, server setup, and ongoing development.

What We Offer:
Dev Rank on the server
Credit & Exposure in the community
Future profit share if the server generates revenue
Full ownership of your work
If you're interested in helping us grow and want to be part of an exciting project, DM me directly!

Best,
Hamzacross100
Owner of XrossHearts

wraith dagger
#

so i can add pathfinder for them attack

slender elbow
#

with nms probably

woeful sleet
#

Subject: Minecraft Developer Needed for XrossHearts

Hey! I’m Hamzacross100, owner of XrossHearts. We’re looking for a passionate Minecraft developer to help with custom plugins, server setup, and ongoing development.

What We Offer:
Dev Rank on the server
Credit & Exposure in the community
Future profit share if the server generates revenue
Full ownership of your work
If you're interested in helping us grow and want to be part of an exciting project, DM me directly!

Best,
Hamzacross100
Owner of XrossHearts

slender elbow
#

bro shut the fuck up

eternal oxide
#

I get exposure!!!!! oh wow

wraith dagger
#
java
   AttributeMapBase attributeMapBase = ((CraftLivingEntity)entity).getHandle().getAttributeMap();
         Map<AttributeBase, AttributeModifiable> map = (Map<AttributeBase, AttributeModifiable>)attributeField.get(attributeMapBase);
         AttributeBase attributeBase = CraftAttributeMap.toMinecraft(attribute);
         AttributeModifiable attributeModifiable = new AttributeModifiable(attributeBase, AttributeModifiable::getAttribute);
         map.put(attributeBase, attributeModifiable);

this code used to work but after update to 1.20.4 it uhhh change everything i guese

slender elbow
#

I was going to redirect you to the services webpage but now I'm mad

blazing ocean
#

I'll do $120 an hour just for you