#help-development
1 messages · Page 966 of 1
so in theory I would just make custom trims and apply it to normal armor here?
what identifier would I use for that?
so long as you're fine with original armor showing under it
Do you mean like minecraft:custom_trim ?
You can use your own.
I mean how do I go from my png to having it show in-game
You google
But you can either use a datapack definition, or some weird in-line (in the itemstack) definition.
Second one needs only RP iirrc.
so I can just define a brand new trim in the resource pack?
no, the definition of trim is in datapack, but through some weird nbt shenanigans you can just.. not do that
I would however recommend the datapack definition, probably easier to maintain.
yeah I'm reading that page right now
I've never seen a better argument for a game adding a chainmail bikini armor set
it would be the easiest armor you could ever cover up with custom armor
lmao
Also, found the inline definition if you really don't want the datapack part
https://bugs.mojang.com/browse/MC-264149
I think I can live with the data pack thing
I probably shouldn't start reading this 14h into my work day though
it's getting to the point where it's hard to keep my eyes open for a whole sentence
any idea how I could convert a ConfigurationSection to a YamlConfiguration?
what?
if you getConfigurationSection you just get a configuration section. It should still be yaml since that's the config format I'm using, but I need a yamlConfiguration to be able to .saveToString
what does save to string return
a string
no shit, what does it look like
the yaml config
so many questions
haha sorry my response was a bit arse there
why do you want a section as a string?
its already a file, in teh config
I need a configurationsection in some cases
I think you are just getting confused
configurationSection already came from a file. Why would you need to put it in another file?
this sadly adds an unnecessary level of complexity to my project
config handling is so annoying
to update the values?!
no
yes exactly that
just use set to update teh section in the existing config
do that how without writing it back to disk?
I don't want them to be changed temporarily
I want them in the file
you cannot call .save on a configuration section
you can on config
I can not on configuration section
you don;t
no
so you get the config using the section
you get teh ConfigurationSection FROM a YamlConfiguration
change it, put it back and save
I get parts of the config as a section so I have them in the native format to put them back into the config easily
I'm using annotations to get variables from a config file. Since I have to specify all the getters manually I save all the more complex types just as the config section:
case "String": {
field.set(instance, config.getString(value.path()));
break;
}
case "boolean": {
field.set(instance, config.getBoolean(value.path()));
break;
}
case "org.bukkit.configuration.ConfigurationSection": {
field.set(instance, config.getConfigurationSection(value.path()));
break;
}
that is very easy to do
there I get the configurationSection. After altering the values there I want to put them back into the config file
(ive done it myself)
the same function also handles the conversion back to the config format and thus only returns a configurationSection
you should be able to serialize and deserialize everything in the config
you shouldnt have to work with direct sections
I tried java's own thing once and all I got was unreadable weird bytecode shit
this is my impl for loading
everything that you want to save has a type adapter with basic ones shipped as default
my deepest respect to the people putting up with reading other people's code
decrypting whatever was written there, even if it's very nicely written is always so annoying
it checks if the file exists, loads the config into a YamlConfiguration, loops all the values in my code config, then figures out the type adapter handles maps only, gets the value runs it through its type adapter then sets the field with reflection
do these things have to be in grayscale?
it has to do some jank stuff with config types because of type erasure
Oh hey you’ve actually modified the code
oh boi, I don't remember that
what does this mean
i made that months ago
it says that the textures reference should be grayscale
this isn't very ocp of you
?tryandsee
because if it has to be grayscale this is dead
have you seen anyone actually do what i"m trying to do with these?
it hasnt been for months
Yeah well I don’t look at it
i literally told you after i did it
Nope
I just always assumed it should be possible in some way
you know what they say about assuming
What’s the maponly stuff about
I wonder what would happen if I gave it a #ffffff pixel and a colored baseline
?tryandsee
I wonder what would happen if I went blind
Is that your husky
I don't see the point of it anyway
No thats a meme
I figured he might have turned one of his into a meme
I think the only way I could get this to work is if I create a grayscale converter and map custom values automatically to work backwards from the texture I want to use
wait no
it's hardcoded to only use 8 pixels worth of color
damn it minecraft
oh bruh, didn't know about that
Sorry for wasting your time with this ;-;
yeah ok so I went with lessfancypants and it just works immediately and it also works with optifine seemingly
I think fancypants might be broken for optifine but not lessfancypants
hm
It will most def. break if you use modded shaders tho
But I would not care about that much
yeah it does
I don't really have many other options here
either it will work with anything but shaders or it will work only with optifine
Mods love to break vanilla shaders
^^
I'd do the same thing in their place, the vanilla shaders suck
does this thing not do boots
Hello everyone, could you help me completely ban the use of a trident with the riptide enchantment? I'm not interested in banning the trident itself, but in banning flights with it. I tried to do this with events, but this is not a solution, it either turns out very poorly (not the way I need) or does not work at all. I tried using protocollib and I think I found something that might work, the S2C ENTITY_METADATA package, but I haven't fully figured it out with DataWatcher. I'm sure this can be canceled, the event is somehow transmitted from the server to the client and vice versa. I will be glad to any tips
this thing does, in fact, not do boots
u could just disable the entchant from being applied
This is how I implemented it this way, but this is not the result I need.
I take that back, this is much weirder than it not using boots
The metadata packet gets sent to every player when an entity's data changes
You can use it to detect flights
But that probably achieves the same as the event itself
It calls the player riptide event before applying the vector
For some quirky ahh reason the riptide event isn't cancellable, at least on the version I'm at
I need to either cancel the flight itself from the trident or pull it (although this is most likely clientside)
I mean yeah, there's a reason PlayerRiptideEvent isn't cancellable :p
trims can only do grayscale, shaders can only work with two layers, this thing just doesn't want to play along
Which is?
Because it does nothing
Trust me. I worked on it recently
I tried making it cancellable but it just did nothing
I mean you can try and make it cancellable, but I think the client just applies its own velocity separately
but I already tried, it did nothing :p
You might need to send a velocity packet to resync
There's a really easy test for this client-sided behavior
just Thread.sleep on the event
And if you still fly then it's whatever
how about adding in a collision fix/toggle
if you teleport the player, doesn't it stop them from the riptide thing?
get their velocity and try applying the velocity in the reverse direction
and play the animation (if that was a thing)
this might sound silly but is there an event for item lore change
@EventHandler
fun onTridentThrow(event: ProjectileLaunchEvent) {
if (event.entity !is Trident) return
event.isCancelled = true
val player = event.entity.shooter as Player
if (!player.isInWaterOrBubbleColumn) return
player.playSound(player.location, Sound.ITEM_TRIDENT_RIPTIDE_1, 1.0f, 1.0f)
val direction = player.location.direction.multiply(2.2)
player.velocity = direction.add(player.velocity)
}
oh yeah
that's what i do
kotlin looks so much like js 💀
or more like TS
fr
check on jd first ig
?jd-s
there isnt
but what if there is with packets, this is why jd isnt the solution to everything
then there's none 🤷♂️
also why not do this with PlayerRiptideEvent
uncancellable
well
well what you do isn't it the same thing you would do with that?
eh idk
because the actual riptide is special
velocity doesn't collide with players
or cancel throwing the trident at all?
💀
public void onInteract(PlayerInteractEvent e) {
if (player.isInWaterOrBubbleColumn) {
ItemStack item = player.getInventory().getItemInMainHand()
if (item.getType() == Material.TRIDENT) {
int level = item.getItemMeta().getEnchantmentLevel(Enchantment.RIPTIDE);
if (1 > level) return;
e.getPlayer().sendMessage("nuh uh");
e.setCancelled(true);
}
}
}```
that's what I do too
just haven't sent that snippet
that still creates like the animation for a bit
that's client side
something similar at leasr
yeah
just make it so u cant hold them
noxesium is currently the best solution ig
arent you trying to disable riptide
ah
silly goose
:-:
:)
where you find this? ._.
hm?
Make an issue on github then or PR it :D
try to make the RP yourself, the .zip is probably not updated
I wasn't going from the rp, I did notice that had gone too long without getting updated
the texture size seems to be programmed such that the only file size that will work is the default one
2*size.y/size.x doesn't make sense
oh, well then I guess you'd have to edit it to suit your needs
that doesn't describe the amount of textures in the file
Look, I don't understand what the shader does
I just know it exists
If you have problem with it, join Minecraft Commands server and tag Godlander
Can anyone pls help me code a plugin?
?ask
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!
Ok, I would love to create a grief alert plugin, it alerts the players who have a specific permission node
For some breakage of some blocks
do you mean like block type or blocks in an area ?
okay first of all
dont do grouping using permissions
many beginners make this mistake
dont do it
Ok thx I’ll consider that
Blocks, like “Player” broke “block-type” at “xyz “
wait
I made a code actually, but it doesn’t work somehow
is there like regions
and players can claim these regions?
or do you just want to alert 1 region to a admins or what ever
No, regions don’t exist
so just the entire world and you want to alert admins when a block is brocken?
It would be nicer if it only alerts for “crafted blocks”, or for a list I decide
Yea*
alr then permissions is fine actually
very simple
onBlockBreakEvent
you first check what block it is
using .getBlock .getMaterial
and then
if you have made sure that its a block that should be alerted
you can loop through all online players with that permission
Should I send here the code I wrote so that u can check where the problem is? Bc it doesn’t work somehow
How
Yea GA
then its missing alot
i dont provide help in dms but i can invite u to my server if u want
Sure
Creating a blank plugin with IntelliJ and Maven (Covers what the JavaPlugin class is):
https://www.spigotmc.org/wiki/creating-a-plugin-with-maven-using-intellij-idea/
Using the Event API (Registering listeners):
https://www.spigotmc.org/wiki/using-the-event-api/
Using the Command API (Registering commands):
https://www.spigotmc.org/wiki/create-a-simple-command/
Smile can you tell me what time it is?
16:05
noice
You are almost at 15k
Wait are you japanese?
Or why do you have katakana characters in youd discord
yo im wondering what dictates the level of code? for example really big projects have this unique way of formatting to their code and its just different from what i write, almost like a completely new language. Im wondering why that is and how I can improve my code to also meet "professional standards"
This mainly comes down to developing a design philosophy.
You should try to understand and apply a few design principles, as well as clean code ones.
I would start with:
- DRY -> Dont Repeat Yourself (Make your code reusable)
- Watch some videos about clean code. (Dont take them at face value)
- Understand a bit about the SOLID principles
And it is very important to understand the strengths of the language you are using.
General object oriented principles like inheritance are imperative to understand for Java.
If you send a repo in #1100941063058894868
Then we can review it and give you a few tips to improve your code.
Thanks 🙏
also, at some point like with anything people develop certain styles. Which becomes very obvious at certain scale
in an ideal world this shouldnt happen
but it does
so just because something looks different then what you are used to doesn’t necessarily mean its better
Im guessing my code will also improve as time goes on based on experience right?
what part of it do you struggle with
using it i guess
well yh
it’s complicated to start
well
to fully understand nms you need to understand how inheritance works, what interfaces are and and and
i havent dealt with it for a while because it was complicated at the start and i just lost motivation to learn it
i recommend you try to only use nms when you have to
until you are able to fully understand stuff like that
have you made minigames in spigot?
im having trouble understanding how a minigame would work, but i have never made a game in java so its probably that
?
well if u need anything feel free to ping me
@valid burrow i need something
i need something from u
your social security number
your birthday
your location
i dont have a ssn
and your moms maiden name
1 large fries. 2 big mac and a large coke please.
💀
coming right up! Do you guys want anything else?
no thanks. that'll be it
55 BURGERS, 55 FRIES, 55 TACOS, 55 PIES, 55 COKES, 100 TATER TOTS, 100 PIZZAS, 100 TENDERS, 100 MEATBALLS, 100 COFFEES, 55 WINGS, 55 SHAKES, 55 PANCAKES, 55 PASTAS, 55 PEPPERS AND 155 TATERS
We have a great menu with cheeseburgers today!
lmfao i instantly remember the video
xd
kekw
laughed a bit too hard at that one
fuck me this was not trivial to set up
one shader, one iron horse armor, one weapon that is actually using resource pack mechanics as intended and one illusion because those boots are a lie
don't bring my name into this
private long packValues() {
return ((long) this.major << 42) | ((long) this.minor << 21) | (this.patch);
}
Is my brain braining correctly? This should pack the major version into the upper 22 bits, the minor into the middle 21, and the patch into the lower 21.
are you making a new simple sem version class
if you are, checkout pineapples
it has support for classifiers
Yes but idc about those
Plus finding anything in pineapple is impossible I swear
this.comparator = Integer.parseInt(modifier + Integer.toString(major) + minor + patch);
kek
integer to string is faster than normal
Hence the bit shifting
it works and their is minimal overhead to Integer.toString
its a few hundred nanos for the Integer#toString and parseInt in total
Unacceptable!
while yes bit shifting is faster its so minute the change isn't worth it
in this case using bit shifting isn't worth it unless you can fit everything into 1 byte
in which case you can save your 24 bits and call it a day
I'm just doing it for the sake of making the code look nicer
idc about the extra 64 bits from the long
tbf an int is probably enough
Idk who is on version 1025.0.0
guess what we just got
pre 2 just dropped
the mojang wiki doesnt even exist yet
how can i get the display name / inventory name of a shulker / chest on an getClickedBlock of a PlayerInteractEvent
oh no
This smells like using names to identify custom stuff
Scary
is anything even happening over on the quilt discord? They still haven't come up with a better mixin alternative as of my knowledge
nha i'm just curious ;D
why would you even try to reinvent the mixin
its great already
plus Mixin Extras
because mixins are annoying any difficult to understand
Get the state of the block -> cast to container -> getCustomName
sounds like you just haven't dedicated enough time to them
its a learning curve because mixing into things isn't easy already
Mixins are much easier than ASM
Well it's probably more intuitive than raw ASM
that's the alternative
Mixins are super well designed and make the process much more intuitive
well quilt pretty much promised an easier alternative
Let me know when it's ready
yeah who would have guessed simplifying ASM would be hard _
trying to simplify a concept most developers don't understand into something people can understand very difficult thing to do tbf
Mixins are pretty similar to the C# system
Granted you can do the C# version with pure code
https://www.spigotmc.org/threads/advanced-resourcepack-mechanics-how-to-create-custom-items-blocks-guis-and-more.520187/
I have a question relating to this tutorial- how do you display the block breaking animation on the block when it technically is just a armor stand head?
they lied and said college wifi was good
using custom model data
These ArmorStands have an item as a head that looks like a block because of its custom model. This model is slightly larger than the real block to avoid z-fighting. However, the break animation is still played on top of the fake block, which makes the block look pretty real.
Apparently it just works
(You have a real block underneath)
oh I guess that works too
wait so a block is there and then the head is made just slightly larger but then when they try to mine it they mine the real block?
yes
what
you can disable the armor stand hitbox if that is what you mean
^ marker armor stands have no hitbox
Granted that tutorial do be old
We have display entities now
is that with setMarker?
I wonder if it's possible to create a marker entity with just the block breaking animation textures
Sure why not
Would it be a problem to use Scheduler instead of BukkitScheduler? As long as I don't want to sync anything with the game 🤔
I mean the bukkit one does come with other benefits
Like cleanup when your plugin is disabled
I understand, but wouldn't it be bad for things that don't have to sync with the game? Because if the server has lag, wouldn't BukkitScheduler "follow the lag"?
that's kinda a good thing for most things
you want things to sync even with the lag so you don't have some random things running faster especially gameplay related data and elements
But would it be recommended to use the default if I want it to occur or if it should be executed even with the server lagging?
why not just run it on another thread then with the async methods?
is their some reason that just doesn't work?
So the best would be to use coroutine?
hmm, i will try it, thanks!
does anyone know what causes this error?
How can I disable villager movement? I have disabled villager AI, but when I click on him, he starts moving his head like, 'I don't have any menu, what do you want from me?'
that's not an erorr more importantly why the fuck are you using unsafe?
Going to keep it real I'm unsure how this even happened do you know the fix for it?
stop using unsafe or and provide an actual stacktrace
I can only help if you actually give me an error you gave me the byte code signature of a method within Unsafe
Thats the only error
no its not
I'll send a screenshot
you've provided 0 context to this "error" than provided me a bytecode signature
I don't accept dms use imagur
?img
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
I already likely know the error likely a Method not found exception its possible sun.misc.Unsafe isn't in his JDK
wasn't Unsafe removed in Java 21
I'm using 8
outdated software and compiling software completely unrelated to spigot
ask the author
Its my own
anyways do as epic said send the stacktrace
click the tope red x and copy and paste into a paste bin
Hey fellas, just wondering if there are any effective methods for serializing entity data out there at the moment. Especially living entities. Just curious whats out there
no standardization I'm aware of
you'd have to make something
Can't you serialize to a byte array with nbt?
yeah but you'd need NMS to do so
something wrong with your maven configuration. What I'm not 100% sure rerun with -X
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.11.0:compile
If you don't think you can understand the stacktrace you'll need to report a bug or search for a solution. Something is wrong with either your plugin or the configuration up to you to figure out which unfortunately.
Update yeah your maven configuration is off
https://stackoverflow.com/questions/42525139/maven-build-compilation-error-failed-to-execute-goal-org-apache-maven-plugins
Cool cool, yeah I started diving into making an entity serialization library cuz I couldn't find any. Just wanted to make sure before I went too deep
I'll be sure to post the utility here for comment once its done. Should be pretty flexible between updates hopefully.
Try to update your maven installation or alter the version of Java you are using to run maven (Java 17 would likely be best)
The SO Question suggested by @river oracle is completely unrelated
The JDK used for compilation is dictated by the JAVA_HOME environment flag (or your IDE if it overwrites that)
criticize me, it would be great if someone could give me any good libs for bukkit commands
alright now i need some serious help
ive been developing plugins for 1.8.8 and now im moving onto 1.20
and heres my error can anyone help?
give me a second
Cloud, ACF
Pineapple Command Library 🤓 🍍
nvm im dumb asf and a little drunk didnt look at the full error
let's say we have Class cl = Foo[][].class
does cl.getComponentType return Foo[].class or Foo.class?
whats unoptimized about minecraft?
Mostly just how monolithic it is
Microservice minecraft incoming...
I'm not saying that
I think you are looking for another word?
single-threaded?
Basically the whole game's designed to run off a "main thread"
Which makes sense when developing from the ground up
If all you care about is delivering content
But it reaches a point where it harms you because everything's so tied together and you can't, for example, make a separate tick loop to process chunks
The only time things are done async is when doing IO
*sometimes
Yeah
?paste
What if minecraft had "microservices" but they were all embedded
Or it just used thread pools to batch process everything
Why config doesn't restart?
if (args[0].equalsIgnoreCase("reload")) {
Plugin.getInstance().reloadConfig();
commandSender.sendMessage(prefix + Utils.color("&aКонфиг был перезагружен"));
return true;
}
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
what
ticking is pretty much the only thing that happens single threaded
networking is done in parallel
the chunk system and generation works in parallel
the lighting engine works in parallel
it just so happens that the few things fall under the ticking mechanism you have a million instances of
What's wrong with plugin.getinstance?
Прочитай
что
Chunk generation and loading are done async however ticking things like tile entities is still done on the main thread
yeah
that's what I said?
We're ending up at the same conclusion that ticking takes forever and that's why minecraft's slow
makes it difficult to maintain that code
the problem is that there are a million things to tick and they all depend on the order so parallelizing that is not exactly easy without extra synchronization
but the claim that Minecraft is single threaded is just not true lol
Well single-threaded isn't the exact term
Which is why I refer to it as monolithic
#HytaleWhen?
never
probably true 😦
chunk gen is not tied to io, what
?? but that's a separate process done by a separate system
Main argument isn't that EVERYTHING is running off the main thread
It's more that the only things done async are side processes that are often done once in a while, or just IO
Once the chunks are generated and loaded everything's just piled onto the main thread anyways
omw to pitch folia
dumb question how i can shade this ?
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>3.12.7</version>
<scope>compile</scope>
</dependency>
my plugin size is like 3mb
iam doing this , but iam not sure if its even change anything .. :L
use the maven shade plugin
and scope compile at each dependency you want to compile and scope provided on those you don't want
is there something like inventory.addItem() but like the /give command, where if the item doesnt fit it gets dropped on the ground?
(ik I can just drop the item on the ground if the inv is full but I want to know if theres a built in feature)
theres an add that returns a map of overflow, simply drop them
wym by "index of parameter" though
index of varargs array ig
correct
sounds like they shouldve used a linked hashset, probably overkill
huh
what huh
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 ...
search for YamlConfiguration
public static FileConfiguration config; config = getConfig(); saveDefaultConfig();
can you help me i have the first config liek this
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
it works :))
but can you help me with the 2nd config
You will use the config API
to load and parse a file
and then store it with your plugin instance
and then pass that around
is this the only way to do a 2nd config?
if yes can you send the dependency thing to import it
what other way are you searching for
personally I use a class that is like the config API but for JSON
an way without an extra api
the API is built in.
oh
you do not need to add any more dependencies
mb im dumb
the wiki page shows this
can you send again
was it this?
Yes...
ik usaly this dc isnt for code writing but could you send the code how to do the 2nd config im to lazy to read the doc 😅
No
If you are too lazy to read, you are too lazy to read my code
It would be useless then.
i think your code isnt as long as the doc
but its ok ty anyways 👍
We can help you understand it, but we won't do your work for you.
that is why it is your work to be done by you 👍
its okay ty for the help you gave :))
monolithic has nothing to do with threads
what is still water's block state? i use 80, but i can fall through the water as if it was air
or do i need to send any packet other than chunk data?
Hey, can anyone help me with a problem: i want to update a blocks type to any coral but it spawns water on the block as well... how can i avoid the water from being spawned? (for example: block.setType(Material.BUBBLE_CORAL) will set the type to the coral but spawn water as well)
Create a block data for it using Material.BUBBLE_CORAL.createBlockData()
Cast that to Waterlogged
Waterlogged#setWaterlogged(false)
Block#setBlockData
thank you!
why 80? where did you get that number from?
from the data generator: https://gist.github.com/phm07/cbf72af1e533c1e088ee808a25f1bfc4
here's the relevant part:
"minecraft:water": {
"properties": {
"level": [
"0",
"1",
"2",
"3",
"4",
"5",
"6",
"7",
"8",
"9",
"10",
"11",
"12",
"13",
"14",
"15"
]
},
"states": [
{
"default": true,
"id": 80,
"properties": {
"level": "0"
}
},
{
"id": 81,
"properties": {
"level": "1"
}
},
...
apparently 80 is the ID for an "empty" water block - IIRC max level is 7 right? so try 87
empty water, interesting
i don't have image perms
?img
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
hm on the other hand, isn't it normal that you fall through it if you only make it be water client-sided?
yeah that's possible, but i didn't find any other packet that would inform the client that the player is now in water
also, if you lose your connection you don't suddenly fall through water (before timing out)
https://i.imgur.com/f2PpUeH.png with level 0 it looks normal. still acting like air though
The client should still interact with it as if it was water
And then the server would freak out and teleport them
I'm doing my own implementation from scratch right now
Implementation of what
The minecraft server
gg
I feel like that’s also a thing
it is definitely a thing
not a fun one tho
I swear people have remade the server in every language imaginable
gleam when
pickel or whatever it's called when
how do i set the player's name? first i looked into player class to find the name then craftplayer cuz thats the only class that implements player that ik of, apparently getName isnt implemented there but craftplayer extends CraftHumanEntity or whatever which implements getName which returns getHandle().name, getHandle returns an entityhuman WHICH DOESNT EVEN HAVE A name FIELD but i kept looking and found that entityhuman implements getName which does this.i.name
im so lost now
yeah because it's fun
so nobody has an idea why water is acting strange?
¯_(ツ)_/¯
any idea how I'd check if a material can be placed down (I don't wanna run into the redstone != redstone_wire problem again, taht's why I'm a bit specific
isBlock
- It's neither on material nor on ItemStack
- I think that would run into the
redstone != redstone_wireprboem
redstone_wire is the block, redstone is the item that you can actually hold
I assure you it is on material
oh I'm bad at coding that's why, I guess I'll give it a try
But yeah that’ll only be true for stuff that’s the same material as an item and a block
agh this redstone edge case is the most annoying thing on the planet
You could make a collection of materials that can be placed fairly easily
I will have to make a collection of all the items that are stupid
and then map them to the good shit
Loop over material -> create block data -> get placement material -> check if item
well thanks for your help I'll see what I can do
Can I change inventory title without sending Open Screen packet? I need to do that NMS way bcs using api version without method for it.
This is the actual implementation of spigot:
public static void sendInventoryTitleChange(InventoryView view, String title) {
Preconditions.checkArgument(view != null, "InventoryView cannot be null");
Preconditions.checkArgument(title != null, "Title cannot be null");
Preconditions.checkArgument(view.getPlayer() instanceof Player, "NPCs are not currently supported for this function");
Preconditions.checkArgument(view.getTopInventory().getType().isCreatable(), "Only creatable inventories can have their title changed");
final ServerPlayer entityPlayer = (ServerPlayer) ((CraftHumanEntity) view.getPlayer()).getHandle();
final int containerId = entityPlayer.containerMenu.containerId;
final MenuType<?> windowType = CraftContainer.getNotchInventoryType(view.getTopInventory());
entityPlayer.connection.send(new ClientboundOpenScreenPacket(containerId, windowType, CraftChatMessage.fromString(title)[0]));
((Player) view.getPlayer()).updateInventory();
}
Do with that what you want.
Int answer: nooo
Dangit he out joked my joke
This will help a lot, thanks mate
Im probably using to old version. 1.19.2, right?
What does getHandle return?
EntityPlayer
wierd, I guees I runned remaped build tols, well build tolls time. This is my first NMS project, so sorry for my questions.
make sure to modify your pom
Hello so long story short i got everything works with my lootbox system , the only thing left is the rotation using nms / packets :
what packet i need to rotate it for 1.8 , and other versions?
yep, that was not modified as well, thanks
PacketPlayOutEntityRelMoveLook is the name of packet correct?
Probably
how i can get the names?
Compare different mappings with this website: https://mappings.cephx.dev
PacketPlayOutRelEntityMoveLook
thank you so much!!
what does it require?
i have 1.20.4 , support but i want to add 1.8 , and latest
yeah its hard but its for my server , also this is how i have it for spawning , and it works just fine , i need to do it for LOOK packet and
PacketPlayOutEntityHeadRotation
PacketPlayOutRelEntityMoveLook
PacketPlayOutTroll
whats the most effective way to generate an bigger amount of chunks?
How tractable does this have to be?
ik i can do moudles
but ehhhhh i don't have time xd
wdym?
How can I check if the server is lagging?
you don't
so, how can I check if the server is lagging? 'cause basically that's what I want
There is a possibility of generating raw chunk data on a GPU. You just have to rewrite the entire generation algorithm in CUDA.
This theoretically will enable you to generate a ton of chunks in parallel.
lol
bruh
System current time milis + a runnable that runs every tick
it's gonna be as good as it gets
humm
wouldn't it makes the server lag if I do that?
i thought at a little bit more simple way tbh... e.g. like when players fly through the world, the generation is also pretty fast
No
downstream has a ServerTickStartEvent which is a bit more precise that a runnable.
Otherwise a runnable is fine.
it's cheap
why do you have a downstream pr
Doing a bit of math every tick isn’t going to make a difference
you have to understand the big O notation to know actual sources of lag
he's cheating on you
D:
@ md fire
the game does far more expensive things hundreds if not thousands of times a tick, a plugin task is not gonna take your server down
the big O? seems like a goal for a movie where one hundred scientists try to get a magic formula
You can simply pregenerate chunks. Set a WorldBorder to 10k and then fill it with a plugin like FastChunkPregenerator or Chunky.
lol no, it's just a measure of algorithm complexity/memory usage
milliseconds per tick
Hi is this correct?
should I use that instead?
it's gonna be more useful than tps
btw its possible to change this text as well? I guess not
no
thats an image
You can change that text via lang file
(maybe using nms?)
or via resourcepacks :p
(I think it's client side)
But otherwise no
then nop
so resource packs
Yes
for lang
ideas?
you can also do it every second but it'll be less precise
hmmm
I need that to be dynamic so nop, I will just put player inventory weight to up title as well that should be good. I need to display weight of bout inventories
You are carrying too much to be able to run
Sorry Steve you can’t carry 50,000 metric tons of gold anymore
That is 1.8 nms. Pretty much nobody here can help you with that from the top of their head.
Go on the protocol wiki and check the 1.8 protocol version. But from a first glance this looks good.
yep, I want to make something like that lol, I already made util when u can set weight per material and u can set max weight for inventory, so not 55132165431 gold anymore lol
so, milliseconds per tick?
can i make the player think it's in a team with custom flags? i want to hide the name of every player to replace it with a custom name system
I try to understand how can I calculate that, let my 2 brains for math try...
yeah, it should be close to 50, if it takes more then it means that tick has slowed you down
1000/tps = mspt?
crafting invedntory (player opened inventory) would be image as well... so I cant rly display weight here oh. Why I want something that hard lol
every 20 ticks draw the line and see how many ticks you had every 1000ms
"draw the line"?
Thank you so much 🙂 , its only for my server the plugin will be on 1.20.4 i do have another classes for 1.20.4 nms
as in do the math
yeah
Could probably just keep track of the last X ticks and then average them
i mean that'd just be avg tps
I want a simple way to check if the server is lagging (below x TPS)
but mspt is not 1k/tps
What do you consider lagging tho
Is a single tick taking 100ms lag? Even if the rest are fine
below 17 TPS for what I want
long time = System.currentTimeMilis();
run() {
double ticks = (1 - 1000 / (double)(System.currentTimeMilis() - time) * 20;
} run every 0, 20L
try this first
okay
i don't think you need to do it every tick
yeah
PS: this highly correlates to how long the runnables before yours took. And runnables are not guaranteed to run in the same order either.
hummm
it's for my Falling Leaves
just use nms
average it and over time it'll be correct
discuss side walls
Just use reflection to override the craft scheduler so you can get notified of the main threat heartbeat
Kek
keep 100 values in somewhere
(idk if I can say like that)
okay...?
how...?
😭
idk how to make that
he's joking
Runnable is fine
oh okay
did you try this? https://www.spigotmc.org/threads/get-server-tps.152860/
I found something like that
that's perfect
even better, It'll be perfect
thanks
This can be changed only with resourcpeack right? but need that dynamic, can I make that with resourcepack? thinking about some solution do display weight... Looks like I will need to learn reourcpacks as well
I don’t think you can do dynamic translations, no
hmm, so its basicly in possible lol, so action bar would must be enought looks like
how do i add below name to the player using armorstands with no delay
Use the second line added by scoreboards or mount a display entity on the player
the scoreboard one has a zero, how do i mount and position the entity to be abit lower?
I kinda want it to display that near inventory. like this but next to inventory, how is this done? all of it is action bar?
yeah. And after they removed negative slimes, they used a minecart (which has a negative size hitbox) and an endermite to get the right height
Yeah that’s probably action bar with some font magic
TextDisplays have a Transformation. This means you can create an offset as high or low as you want.
alr
They also allow multiple lines
Mojang should just make the player name tag a TextDisplay fr
Im just trying to find out how they get that thinks next to item bar, maybe I will be able to do it that way but upper lol. I know that images are not rly images but unicode chars
mojang should stop adding useless stuff like the score for scoreboard objectives or add a way to remove them 😭
What
they force sidebars and below name scoreboard objectives to have a zero or whatever score u have
u can for 1.20.3 or higher
Exactly
do u know how long scoreboards have been here for
yeah i mean they aren't gonna go around backporting stuff
they added the thing you're asking for
idk what your point is
the amount of 1.20.3 or higher in my server will prob be 1 or 3 max
i personally didnt even update yet cuz the mod devs dont want to update their mod
Wait let me get the image
asks for feature
gets feature
complains feature doesn't exist in older versions
peepostare
I want youtube on my telegraph
peepostare
hi , uhh i could not find this packet :
PacketEntityLookMove
https://github.com/Attano/Spigot-1.8/blob/master/net/minecraft/server/v1_8_R3/ and in server i get this error :
i tried using PacketPlayOutRelEntityMoveLook but its the same
that's like 30% 1.20.1
you can be the one making that number smaller
you realize most new players will just join the newest version which means old versions will die in the end
smh
well its gonna break for 2nd most people
which isnt just like 5 players that i can ignore
even hypixel has something similar to viabackwards :-:

and they def profit more than most servers do
sure but hypixel is not your average server
whats different in hypixel
and you don't have to be like them either
It’s hypixel
money only
they are in their own realm
In statistics it’s called an outlier
im just gonna do the text displays method
Maybe we should embrace bedrock edition more, it doesn’t have a version selector
Jk I still don’t really like bedrock
if you have FireworkMeta how do you set it explosive?
Like if you add a firework star to a firework
just enough to make it do damage when launched at a player
addEffect(s)
how do i get the verified role, i verified
The bots been slacking lately and !verify doesn’t seem to like working
!verify
Usage: !verify <forums username>
i did that but it didnt give me the role before
Blame discord
thanks I got it
i got rotation working with nms / packets :p
finally
and its soooooooooo smooth :p
not sure but i think Parrot have its own method no? to set it to shoulder?
"real one"?
the setshoulder one is deprecated
how do i make passenger's yaw the same as the player when you move around
it's deprecated more as a warning, "use with care", but in general, deprecation doesn't necessarily mean for removal
ok
Hey guys, is there any way to access entities that aren't loaded?
No
I recently stumbled upon an old world save I had, and I'm looking for a couple mobs since they'll show me where my old bases are
How old
Can probably open it in mcedit and do something from there
Ohhh good idea
Either that or you need to parse the NBT for all the regions and then sort through it
for(Entity en : p.getWorld().getEntities()){
Location loc = en.getLocation();
String locationStr = loc.getX() + " " + loc.getY() + " " + loc.getZ();
String returnedName = en.getCustomName();
if (returnedName == null) {
continue;
}
if(returnedName.equalsIgnoreCase(nameArg)){
p.sendMessage(ChatColor.AQUA + returnedName + ":");
sendClickableCommand(p, ChatColor.AQUA + locationStr + "\n", "/tp " + locationStr);
}
}
made this before I realized I couldn't target unloaded entities
Works for loaded ones tho
pretty well
Makes sense that you wouldnt be able to access unloaded ones tho
since they arent in memory
only on disk
One option if you rly want to use spigot for it is to combine it with a world loader plugin and then your own custom search plugin to search for "on chunk load" or similar event if your entity is there
I was thinking of doing that
But the world file is really big
It used to be a server map
It was a vanilla server that ran off of commandblocks
We had a custom land protection system where players could place a custom named shulker entity
It just used the player's name
So my thinking is that if I can search for a specific name, I can find that player's base and bring back some old memories
It won't even load in MCEdit, unfortunately
Due to the age of the world, or?
If it's due to the size (no harm in trying a few chunks), you can convert the world by a few.. dozen? chunks at a time
That's a good idea
I'll try that
I wish there was an easier method to do this
I give up
How many chunks is there? 💀
The file is over 10gb 💀
that's nothing
13gb to be exact actually
is your PC specs poor?
send me a few chunks to mess with
ill check
any advice on level system mathematics regarding exponential growth?
make a random equation
I'd do logarithmic growth though
is their any way I could make a mob not agro on a specific player?
I'm fine with any NMS and such just need pointers
...wouldnt that mean xp to next level or whatever would get less and less as level increases?
@EventHandler
public void NoTarget(EntityTargetEvent event) {
if (event.getTarget() instanceof Player) {
Player p = (Player) event.getTarget();
String playerName = p.getName();
if(playerName.equals("SomeName")) event.setTarget(null);
}
}```
Try something like that
sohree eye tieped it how eye pronounse it
bros from Boston
sweareded
~types in irish
Glad to see you got it working!
Did you get the boots fixed ?
Quick question, if I do
container.set(key, PersistentDataType.TAG_CONTAINER, child);
if I then update the child container, is the parent container updated with the new values of the child container too?
if u get same child it should update
i feel like i want to use PlayerChatEvent instead of this, is there a reason that should stop me?
Hey how would I save an entity / entity snapshot (either works) as a string? then make a new entity from that string?
}, 0L, 20L * plugin.getConfig().getInt("koth-timer"));
why is this tasktimer spamming ?
We'd need more details than that 💀
like?
not really
have you made sure the „koth-timer“ is retrieved propperly
print it out
nvm fixed
Bro says not really then asks
