#help-development
1 messages · Page 105 of 1
ah fun -Double.NaN is still the same
Is there a common way to get coloured wool/dyes across all versions? In legacy we used to get an Ink Sack, and set the data to the colour we want, but in recent versions we just get the material for the dye.
XMaterial
Thank you.
What's line 26 of your Click class?
well "inventory" is null
Its opening the inv
"inventory" in line 26 is null
what are you setting it to?
or just ?paste the whole class
tf
i instanced all inventories
?paste
https://paste.md-5.net/avizedumih.java this is for adding items
why does ItemMeta.getLocalizedName always return an empty string? do i need to specify a lang file somewhere?
Yes
i have 9 invs
inv1 = Bukkit.createInv("stuff);
and taking it
but returns null
also to whoever said i shouldn't round the percentages on the quest progress
i think these rewards are pretty good ngl
bump
server properties or something
ive been through every config file i can find and theres nothing like that
isnt the localized name a client thing
idk because people can make their own languages in a texturepack
from what i can tell thats the item name in the language the server is in
It’ll only return something if you’ve done setLocalizedName iirc
The server only has the English Lang
because to get seomthing u need to set something
also why dont you just get the item name? if you're only using the server localized name
cause thatll be something like DIAMOND_SWORD
i see
is there a parameter to specify the local lang
something like setLocalizedName(LanguageOrSomething.YOUR_LANGUAGE)
ive got no clue about what that method actual does so theres my shitty suggestion
anyone know how can i do that: https://imgur.com/a/F89TWoB
using .setPassenger(entity), but which one?
What does marker mean on an armor stand
Means it basically has no hitbox
ah I see ty
what is that?
The cloud spawned by lingering potions
ok, i ll see
to communicate to other plugins as an API plugin should i make my own events like QuestCompleteEvent
or should i just let them hook on directly
to the plugin instance
and get the data direct from the hashmaps/where the data is stored
It would be very nice for them to have an event to listen for even if they can directly access your plugin
google about observer pattern
i have a yaml file with multiple entries (closed reports), where each report has a resolve timestamp (system.currenttimemillis). i want to check how many reports have been closed today - so, 86400000 or less milliseconds from now. what's a good approach to take here?
i added more commands in my plugin.yml and now it gives me this error
java.lang.NullPointerException: null
at me.gurwi.ChatManager.onEnable(ChatManager.java:30) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[patched_1.12.2.jar:git-Paper-"77cce8236"]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:316) ~[patched_1.12.2.jar:git-Paper-"77cce8236"]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405) ~[patched_1.12.2.jar:git-Paper-"77cce8236"]
at net.frankheijden.serverutils.bukkit.managers.BukkitPluginManager.enableOrderedPlugins(BukkitPluginManager.java:192) ~[?:?]
at net.frankheijden.serverutils.common.managers.AbstractPluginManager.enablePlugins(AbstractPluginManager.java:105) ~[?:?]
at net.frankheijden.serverutils.common.managers.AbstractPluginManager.reloadPlugins(AbstractPluginManager.java:219) ~[?:?]
at net.frankheijden.serverutils.common.commands.CommandServerUtils.handleReloadPlugin(CommandServerUtils.java:243) ~[?:?]
at net.frankheijden.serverutils.dependencies.cloud.execution.CommandExecutionHandler.executeFuture(CommandExecutionHandler.java:95) ~[?:?]
at net.frankheijden.serverutils.dependencies.cloud.execution.CommandExecutionCoordinator$SimpleCoordinator.coordinateExecution(CommandExecutionCoordinator.java:123) ~[?:?]
at net.frankheijden.serverutils.dependencies.cloud.CommandManager.executeCommand(CommandManager.java:188) ~[?:?]
at net.frankheijden.serverutils.dependencies.cloud.bukkit.BukkitCommand.execute(BukkitCommand.java:116) ~[?:?]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:152) ~[patched_1.12.2.jar:git-Paper-"77cce8236"]```
at org.bukkit.craftbukkit.v1_12_R1.CraftServer.dispatchCommand(CraftServer.java:685) ~[patched_1.12.2.jar:git-Paper-"77cce8236"]
at net.minecraft.server.v1_12_R1.PlayerConnection.handleCommand(PlayerConnection.java:1492) ~[patched_1.12.2.jar:git-Paper-"77cce8236"]
at net.minecraft.server.v1_12_R1.PlayerConnection.a(PlayerConnection.java:1297) ~[patched_1.12.2.jar:git-Paper-"77cce8236"]
at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(PacketPlayInChat.java:45) ~[patched_1.12.2.jar:git-Paper-"77cce8236"]
at net.minecraft.server.v1_12_R1.PacketPlayInChat.a(PacketPlayInChat.java:5) ~[patched_1.12.2.jar:git-Paper-"77cce8236"]
at net.minecraft.server.v1_12_R1.PlayerConnectionUtils.lambda$ensureMainThread$0(PlayerConnectionUtils.java:14) ~[patched_1.12.2.jar:git-Paper-"77cce8236"]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
at net.minecraft.server.v1_12_R1.SystemUtils.a(SourceFile:46) ~[patched_1.12.2.jar:git-Paper-"77cce8236"]
at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:850) ~[patched_1.12.2.jar:git-Paper-"77cce8236"]
at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:423) ~[patched_1.12.2.jar:git-Paper-"77cce8236"]
at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:774) ~[patched_1.12.2.jar:git-Paper-"77cce8236"]
at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:666) ~[patched_1.12.2.jar:git-Paper-"77cce8236"]
at java.lang.Thread.run(Thread.java:829) [?:?]```
did you add it to plugin.yaml?
?paste
Yep
we can't exactly see your code ._. and learn how to read stacktraces me.gurwi.ChatManager.onEnable(ChatManager.java:30)
@vivid skiff
show us code
k
this line and the context
preferably
The commands or the main?
ok
import me.gurwi.commands.Action;
import me.gurwi.commands.Scream;
import me.gurwi.commands.Whisper;
import org.bukkit.plugin.java.JavaPlugin;
public final class ChatManager extends JavaPlugin {
private static ChatManager instance;
public ChatManager() {
instance = this;
}
public static ChatManager getInstance() {
return instance;
}
@Override
public void onEnable() {
long start = System.currentTimeMillis();
// COMMANDS
this.getCommand("scream").setExecutor(new Scream());
this.getCommand("whisper").setExecutor(new Whisper());
this.getCommand("action ").setExecutor(new Action());
// LISTENERS
// CONSOLE MESSAGE
System.out.println("");
System.out.println("§8§l» §3§lCHAT§b§lMANAGER §7v1.0");
System.out.println("");
System.out.println("&7Plugin enabled successfully. §9(" + (System.currentTimeMillis() - start) + "ms)");
System.out.println("§f§oBy @Gurwi30");
System.out.println("");
}
@Override
public void onDisable() {
long start = System.currentTimeMillis();
// CONSOLE MESSAGE
System.out.println("");
System.out.println("§8§l» §3§lCHAT§b§lMANAGER §7v1.0");
System.out.println("");
System.out.println("&7Plugin disable successfully. §9(" + (System.currentTimeMillis() - start) + "ms)");
System.out.println("§f§oBy @Gurwi30");
System.out.println("");
}
}```
"action "
i guess one of them is 30 lol
this.getCommand("scream").setExecutor(new Scream());
this.getCommand("whisper").setExecutor(new Whisper());
this.getCommand("action ").setExecutor(new Action());
probably the space
yes
and i asked for the context not the entire goddamn file
@vivid skiff this will come in handy https://www.spigotmc.org/threads/tutorial-how-to-read-stacktraces-solve-most-of-your-plugin-problems-by-yourself.48121/
1.8.8 there is no AreaEffectCloud 😦
@tardy delta
https://paste.md-5.net/viwijiroja.cs
Smh your lib is broken
Isn’t there an algorithm for parsing expressions? I thought someone sent it earlier.
Reverse Polish or something
redempt has his library
Reverse polish notation is a calculator notation
i am thinking of getting all the closed reports in a list, then filtering out those, where (now - resolve) > 86400000, is that a good idea or is there something better?
this already works lol
Yeah but isn’t there a way to convert regular expression forms into RPN and then evaluate?
probably
Idk I remember doing this as an assignment maybe last year I just don’t remember the terminology
Is there a way to reduce the armor/bypass the armor of a player during an EntityDamageEvent?
Set damage to 0 and subtract the amount from their health
if you have a division x / y, hows y called?
do you mean the dividend?
or was it called divisor, can't recall
wait, no,
x would be the dividend and
y would be the divisor
divider
is there an easy way to prevent item to be rename in anvil ?
there isn't item flag for example
I'm trying to package a plugin that I've made, inside a maven multi module project. However, it doesn't seem to be able to find two really important modules of mine (i'm running package on a module)
Any clue why that is?
[INFO] --------------------< com.mrkelpy:Crucible_1_7_10 >---------
[INFO] Building Crucible_1_7_10 1.0
[INFO] --------------------------------[ jar ]---------------------
[WARNING] The POM for com.mrkelpy:Commons:jar:1.0 is missing, no dependency information available
[WARNING] The POM for com.mrkelpy:CNMS:jar:1.0 is missing, no dependency information available
[INFO] ------------------------------------------------------------```
It just says it's missing
As long as just the pom is missing its okay
yeah but the build fails
Oh wait, there's more
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException```
how can i check if player got - health after damage event? i wanted to do it like if oldhealth > newhealth but i cant figure out how can i get player's old health?
I didn't run any commands, I just clicked package in intellij as i've always done, but that just does mvn package
For your com.mrkelpy:Commons and com.mrklepy:CNMS artifacts you need to do mvn install (or mvn deploy if applicable) to push them to a repository
Otherwise dependencies will not be able to resolve them
if i make an api i should use interfaces right?
Player#getHealth
I see, i'll just do it for every module then
Based on what you want to achieve
and rerun
if that is health before damage, then which is new health?
It depends
I think so, the event is called before affecting damages to the player
APIs are usually interfaces, but they mustn't be
im basically making a simple chat color api
how can i get player's new health then?
Then you probably do not need interfaces
I don't think you would need interfaces in chat lib
just plain classes?
:∆
It really depends on what you want to do.
Get player health, substract damage
😄 i didnt know its called records
what do you mean
p.getHealth() - p.getLastDamage()?
You won't find a lot of use for it
And then set it as a player health
setHealth()
to check if player got damaged or it was empty click
Alright
i need to not do anything with cancelled events
I have no idea what empty click is but alrighty
yes i did this @EventHandler(ignoreCancelled = true)
but it wasnt enough
it does not filter empty clicks on worldguard regions
empty hand clicking what?
No, the second member should be event.getDamage() or smth like this
getFinalDamage()
^
thats after modification for armour etc
awesome pfp
Why does Player#setAllowFlight(true) reset on death or on join?
server settings
java 8 doesn;t support newer types of switch
use different java version?
Yes definitely
Java 11
yes
sigh
and yoru compile target/source needs to also be 11
hgis
thats not why btw
go to ur intellij settings
and change it there too
ur langauge lvl is set on 8 and prob ur jdk too
good old Ij having its own settings 😦
Ctrl+shift+alt+s
changed that
.
I can probably find the settings menu
faster
than that "shortcut"
i dont think a shortcut is supposed to be 4 buttons 💀
skill issue then
u did dis too?
didnt really think that one through 💀
in bedrock edition and education edition there is something called fatal posion
though its display name is the same, the id of the potion differs
it happens when u give a cookie to a parrot
thats probably the only reason they added, because of the lawsuit mojang got, when kids started giving their parrots cookies
and thats prob why they didnt do it in java edition
since most java edition users are older than bedrock edition users
😂😂😂
I mean they still die in java
yeah but not get fatal posion
in BE and EE u can see the green particles covering the poor parrot
You still see the particles in java
o
I'm trying to use XMaterial, and for some reason there's always this error happening.: Could not initialize class com.cryptomorin.xseries.XMaterial. I have no clue why. I have shaded my jar and the library is scoped on compile.
That's really all, since it's printed to the server's console, and i'm doing remote debugging on it
I could do JAR debugging, but that'd have to be on another version
it's shaded
see if it exists
Could you send us the compiled jar?
yep it does
for sure
1s
Actually the error is that it can't be initialised, and I just noticed they say that some modules depend on others...
and for some reason there are only two there, even though I'm not doing exclusion
might be that?
No
the XMaterial class is simply an enum
Your server says its not in teh jar you uploaded
but it is there though, which is weird
and when I debug it, I can use the eval feature with it normally
its in the jar you sent us. I'm guessing you failed to update your server
or you uploaded the unshaded jar
?paste your pom
I'll be pasting three POMS, since this is a multimodule project, then.
**Commons Class (Where the library is used, and depended): **https://paste.md-5.net/aliwedikof.xml
Plugin Version Release Class (Has Commons as a dependency): https://paste.md-5.net/ohadupodeq.xml
Parent Module: https://paste.md-5.net/salopuhibu.xml
it looks fine from what I see
The only thing that coudl cuase an issue might be
/* JADX INFO: Access modifiers changed from: private */
/* loaded from: com/cryptomorin/xseries/XMaterial$Data */
public static final class Data { /* <snip> */
static {
String version = Bukkit.getVersion();
Matcher matcher = Pattern.compile("MC: \\d\\.(\\d+)").matcher(version);
if (matcher.find()) {
VERSION = Integer.parseInt(matcher.group(1));
ISFLAT = XMaterial.supports(13);
return;
}
throw new IllegalArgumentException("Failed to parse server version from: " + version);
}
}
Chances are your server is not compliant to that regex and thus throws an exception
could be
And since you are using a nonstandard server jar it is possible that this exception is supressed/discarded
Chances of that actually happening are rather minimal, but that is the only explaination I could scramble
Let me check
is there a way to get the Plugin from a NamespacedKey ?
not really
you can look up a plugin by its name
but no guarantee that plugin is loaded
would that be the key.getNamespace() ?
Oh my
@quiet ice That is actually what's happening here.
Jesus christ, good job lol, thank you!
yes
Beware that plugins can actually create arbitrary namespaced keys
Is there a way to remove the text under a potion that says its potion effect?
nearbyChunks.toArray(new ChunkContainer[nearbyChunks.size()]);
Doesn't this just replace whatever's in "nearbyChunks" with new ChunkContainer[nearbyChunks.size()] or am I mis-understanding what toArray does 🤔
No, it input all the nearbyChunks in the new ChunkContainer I guess
🤷♂️
Ah, because NetBeans gives the New array created just to be passed to Collection.toArray
code
ArrayList<ChunkContainer> nearbyChunks = new ArrayList<>();
int cX = chunk.getX();
int cZ = chunk.getZ();
for (int x = cX - radius; x <= cX + radius; x++) {
for (int z = cZ - radius; z <= cZ + radius; z++) {
nearbyChunks.add(new ChunkContainer(chunk.getWorld(), x, z));
}
}
return nearbyChunks.toArray(new ChunkContainer[nearbyChunks.size()]);
thats cause netbeans is a shit ide
why
Eclipse fails to handle certain large projects, and IntelliJ doesn't have workspaces which requires you to open up the entire directory instead of per-project
I can do this w/ NetBeans for example, but not IntelliJ
but dude
I can code Paper on IntelliJ but not Eclipse or NetBeans since they break
ur really using that god awful ui
the ui isn't bad lol
I have no issues w/ the UI, in fact I heavily dislike IntelliJ's UI and UX
this is my longstanding issue with intellij I spent 5 hours trying to make the ui nice and it just wasn't working
Meh, I can just disable NetBeans's hint for that specific thing
I don't really like anything about Eclipse & IntelliJ is only useful to me for Paper coding so meh
Hell, iirc the way IntelliJ handles git is more annoying too
well
eclipse is lightweight, but has issues with hints and correction, as well as the way its organized
intellij has issues with git, but is laggy as fuck nowadays, and lacks some features from eclipse and has absolute shit of a swing designer
my only issue with eclipse is how it handles maven
lol
I quite dislike IntelliJ's .idea folder bullshit as well, annoying to deal w/
whats in its .idea folder lol
dumb shit related to IntelliJ
All this stuff
i just code in notepad++
ez
no joke i actually made a forge mod in notepad
and built it and shit
lol My favorite thing about is intellij is seeing invalidate caches all the time
why does it break so much that you need to do that
Anyways back to cleaning up Aurora so I can get that v5 out lmao
Real men use punch cards to make the bytecode
Is there any other way to get a Material with non version dependent code, without using XMaterial?
Why no xmaterial?
Doesn't seem to work for lower versions
like 1.7.10
For anyone that runs into my issue: We can just use Material#getMaterial(String); and use a ternary operator to give it an alternative.
Hi guys i really dont have that much ram to run intellij, 3 minecraft servers and minecraft at the same time so i just want to ask would this code be fine and would it work correctly basically what i think it should do is just connect player to another server on invernotry click event
So this is in onEnabled
Bukkit.getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
This is in onInventoryClick event
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF("Connect");
out.writeUTF(serverName);
player.sendPluginMessage(this, "BungeeCord", out.toByteArray());
i think that it should work properly but i would like to hear other thoughts on this
cant run 3 servers on local host
intellij and minecraft
at the same time
that is shit ton of RAM
run the servers with 2gigs of ram each maybe 1
close intellij
a proxy you can allocate 512mb of ram
for your client you really only need 2 gigs
at bear minimum you need 4.5 gigs plus whatever intellij has
My intellij uses 4GB 😦
given if you only have 8 gigs of ram which is unlikely very runnable still
I don't use intellij lmao I hate that ide I'm using vscode
Is there some way I can slow natural regeneration for players?
vscode hasn't even crossed a gig for me I have a massive project open as well
OS?
It only used to use 1 but then an update to either windows or IntelliJ fucked it
Windows 11
Didn’t meant to upgrade
Mean
llol
might as well use notepad
u only gain shame with using vscode
🤷♂️ as I always say works fine for me I have no issues with it being slow auto-completion is of adequate speed the git integration is amazing works fine with maven/gradle
vscode is fine 😦
notepad++ = cracked
lame
its how true devs work
lemme guess you code in C?
no lol
programmin in notepad is a very common joke in these chats and online with programms
i coded a forge mod
Gotta use VIM
with notepad++
thats one of my coolest achievements
my other achievement is spelling achievement right
ik... you still prob use C
no i'm a java dev
^ exactly
ah. fair
they give a hardcore nerd aura
they got their discord on lightmode
one symptom is that u get the unstoppable urge to call them a nerd
...
yea.. im stumped
Do you use linux?
not too often. not sure who u were asking
2Hex saying no good use case for c
someone has to maintain legacy c code bases 🤔
ooooh good point
Windows, Linux, etc all written in c
No
Pretty much all modern OS's are written in C.
yes 🤓
No but what I am telling you is that there are plenty of C use cases
pretty sure you can make an operating system with other languages tbf
it just wont be as fast
it's so low level i dont think there is any maintenance
there is
one bad thing though
it doesnt get updated much
like what?
since if it did any major updates some code bases would break
thats what i heard at least
you can, but the issue isn't just the OS, as that is only half the battle. It also comes down to hardware. If the hardware you are using only knows c or C++ code, then an OS that is created/designed around that native language will always perform better then an OS that attempts to proxy or translate.
well i mean they could just add stuff and not remove anything. or just depreciate it
linux blows windows out of the water. I wish linux was supported by more games tho
ths guy on quora
"They are usually made with the C#, C, C++, and assembly programming languages. Operating systems allow you to navigate through a computer while creating storage and executing commands. Don't think it is easy to make one."
csharp
bro 💀
Yeah, on a higher level
Windows is loaded with C# code for things like the app store
i like how this went from 2Hex roasting vscode to us talking about OSs
microsoft failed miserably when they used csharp in Windows Longhorn though
Just buy an Jetbrains all products pack
i guess they only use it for small stuff now
wdym by the change simultaneously? do you mean like a synchronized between players bossbar?
For timers always use the observer pattern. Have a fixed timestamp stored and use tasks to view at the timestamp.
You would have a runnable which looks at the timestamp and updates the bossbar accordingly.
The timestamp can be lowered or risen resulting in every observer to have an updated value on the next poll.
Its not a "true" observer pattern but still the right approach for timers
If you want the boss bar to show progress too you’ll also need the start timestamp
Anyone has code to stop an item from being moved into the top inventory?
It can be rearranged on the bottom inv but nit moved to the top
I think you just need to cancel all top inv interactions and shift click / double click in the bottom inv
What abt clicking the item and then dragging it to the top inv
I want the top inv to be usable like storage
Just wanna blacklist items
This is automatically cancelled by not allowing top inv interactions
Then this is quite a bit trickier
Hi, people. Does any one knows how to get the ItemMeta from the ItemFrame ItemStack? I need to get the invisible item frame but they have a custom EntityTag to make it invisble... I was searching from something like the SpawnEggMeta meta... Thanks 😄
You want the ItemMeta of the ItemStack inside an ItemFrame?
For apis, do I need to make every class implement interfaces. And where is the Block interface implemented here? https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/browse/src/main/java/org/bukkit/block/Block.java
i need to get the itemframe itemstack the entity
whats the best way to disable movement on a entity/player ? PlayerMoveEvent is glitchy, slowness doesnt work great either cause they can jump, and disabling AI wont work cause it must work for players too
ItemFrame frame = ...;
ItemMeta meta = frame.getItem().getItemMeta();
like the command 'give @p item_frame{EntityTag:{Invisible:1}}'
Block is implemented in CraftBlock
You want the entity or the itemstack. Make up your mind.
Ok so you want the ItemStack which places an invisible ItemFrame when placed.
And for all my classes in my api, do I need to define their methods in an inteface and implement it for my class.
yep
Let me think if there is a way without using spigot unsafe methods
i saw the https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/meta/package-summary.html But I think none fits me
It would have to be something like an EntityItemMeta. It would also apply to ArmorStands
maybe with PersistentDataHolder?
I mean you can do it via the PersistentDataHolder but then you would have to implement additional logic.
If you want vanilla behaveior then something like this is needed
ItemStack itemStack = new ItemStack(Material.ITEM_FRAME);
Bukkit.getUnsafe().modifyItemStack(itemStack, "{EntityTag:{Invisible:1}}");
I didnt find any that would fit. It would have to be something like EntityItemMeta
Same for ArmorStands
Idk if anyone answered but you used to be able to give higher than 100 jump boost meaning they can’t jump
Yeah just set the movement speed to 0 and give them jump 250
thanks, i will use getServer().getItemFactory().createItemStack("minecraft:item_frame{EntityTag:{Invisible:1}}")
Interesting
Didn’t know you could turn command language into an ItemStack that easily
yep jajaja. Im using 1.19... Dont know when was that addition
that exists?
wtf
why is there an nbt api
oh they're all deprecated
But i wonder why there is no ItemMeta regarding the spawning of Entities by now. There are a few types like ItemFrames, ArmorStands and EndCrystals who would benefit from that.
because spigot does not know a difference between an alive and ticking entity and purely its data
Well CraftBukkit just wraps the NMS Entity which can as well not be spawned
Well, still a "bad" representation of an entities data
preferably all the persistent changes to an entity would be in some form of data attachment
interface wise
Yeah the only way im currently seeing is deserializing the entity, changing it and serializing it again...
So we would have something like EntitiyData > ArmorStandData. Eh...
idk
all a pretty ugly system
tho well
if I can get a spawnEggMeta.setSpawnedMob(Zombie.class, z -> z.customName(Component.text("He"))
that would be kinda nice
I'm Italian and I'm translating this message, I wanted to ask if you can refund a plugin purchased for a server but it doesn't work for 1.19, can you help me?
Have fun trying to serialize anonymous classes
Does the plugin page state that it works for 1.19?
hm ? no
the server would pass in a mocked/whatever ref from a zombie's data interface
which I can edit
Ah i see. Yes this could work then. But then there is not much of a reason to use Consumer. Could as well return the object for editing it.
Yes
Hmm
Unless you want to encapsulate it
Write a ticket or something
you are right, probs returning it might be nicer
or maybe just build the data attachment
so people don't think they can edit it later
For me the consumer implied that the method would be invoked when the mob is actually spawned instead of right now
how?
tho you'd have to also actively return it to the meta
i used -100 jump boost instead and it worked fine lol
if i gave over 100 then they jump to the moons
else you'll get like
final ZombieData zombieData = meta.setSpawendMob(Zombie.class);
// 5 ticks later
// heh I am just gonna edit this real quick
zombieData.customName(Component.text("the future is now old man"));
Yeah this makes sense
so would probably be best to instead like
final ZombieData data = Bukkit.createEntityData(ZombieData.class);
zombieData.customName(Component.text("the future is now old man"));
meta.setMobData(data);
or have some re-exposed ZombieData.plain()
I must say I have fallen a bit too much for the static constructor-likes
damn you adventure
- Write the developer of the plugin for support
- Look in the forum for how to handle this. But there is almost no chance for refunds.
This is not the right channel to ask btw
EntityData?
Yes Adventure is a bit weird in that regard...
Sorry
Especially because everything has a static constructor method for anything else it seems...
I mean it works pretty well. I really have not ran into many issues when simply moving pure function logic into a static method
like OO wise
Static constructors are different
Static constructors?
Unless the type has no children it should generally be a regular constructor
public static ClassName create(params) {
...
}```
I mean, the reason you have them as static is because the implementation is not public
you keep it package private and completely abstract the entire implementation away
so with your static constructor in the interface you basically say "look here is my known implementations of this interface, but feel free to create your own implementations"
Something that would not work in kotlin because for some reason it doesnt have protected as an access modifier.
Just wanted to throw that in because it sparked a bit of rage in me recently.
lul
but why protected ?
why would you need protected 🤔
or is the default kotlin modifier public
Why would you Not Not need protected?
default mod is public
protected is pretty meh
well tbh inheritance is pretty meh
ah
so you don't get package private in kotlin ?
Nope
like ```java
final class PackagePrivateImpl implements PackgePublicInterface {
}
rip
kotlin moment I guess
Package private on the other Hand makes Sense to Not exist

I mean, use java 9 modules then
to actively prevent access to classes you don't want visible
no
you defined "inv1" in this line
but obviously "inventory" != "inv1"
I asked you to send the full class
/shrug if you don't, only javac can tell
¯_(ツ)_/¯
I'D BEEN TRYING TO FIND THAT FOR SO LONG
hey remind me, I can give a living entity a team to use a bar under their display name right?
or was that a fever dream
I believe that this is only possible for players, no?
that's what I was trying to remember
I mean I can just cheat with armorstands, it's just a bit lame is all
Not as far as im aware
I mean either they do or they have found a very creative way of pranking me
Interesting might have to try that
You should 100% be able to put them on a team, that’s how the glowing effect gets coloured
But I don’t think anything will display below their name
about to find out actually
after i do 10 waves of my tower defense game lol
k yeah no
not displaying
or maybe I just did it wrong
map
map
Map<UUID,Integer>
lmfao
Or Object2IntMap<UUID>
You can also store the number right in the PersistentDataContainer of a player. This way its persistent through restarts and relogs.
FastUtil isn't exposed in Bukkit
Ah
anyone know how i am able to fix this? I am compiling a plugin which depends on another api which uses a class which extends a moj map class. I am still remapping it in the pom but it doesn't want to compile
To make it more clear;
I'm using this class in my plugin
addEntityType(ViciousWolfEntity.class);```
which is from an api which extends the moj map Wolf class
i did a thing
looks like if i import non remapped spigot it works but it's not ideal
What on earth have you done
testing
very top secret scientific procedures
(i just made it so every time an entity dies a tnt spawns but apparently tnt exploding is an entitydeathevent)
not sure what it has to do with the lighting engine though
tbh ive had worse happen
you dont want to know what happened with falling blocks
ill go find the video
well its spawning tnt every time it explodes
why do i have 142 pages of messages containing "tps" in this channel
heres one thing that happened when i was doing something i dont remember what i did to make that happen
i think this was the video
and no i didnt apply any vectors
actually yes i did
they were normalized though
i actually dont think i fixed that bug
i basically just applied about 4 million vectors to a falling block per tick
it was supposed to be a custom kb thingy but i spammed tnt
I guess I can help you
or did you already find any fix?
i just used the non moj map import on the plugin and it works
but i dont really like doing that
yeah no
that's not a proper fix
wait
lemme searxh my forums post about a similar thing
sweet thankyou
I had to switch to using the eclipse compiler in maven
I still have no clue why this happened
oh so it's just a intellij thing then?
no
it's a problem with the maven compiler
or with the compiler that mojang used to compile this class
just try it, no idea if it helps you too
Lol the bug I reported earlier today is out to get me
How do I set the CanPlaceOn and CanBreak tags within ItemMeta in 1.19?
Specifically, I'm having trouble making the NBTTagList
last time I checked, you needed to use NMS
so yeha, actually changing the NBT tags
what issues are you having with the NBTTagList?
paper has API for this
spigot doesn't seem to have one
my life is a lie
how so
does inventoryopeneven not trigger when a player opens their own inventory
nope
lies and deceit
it's been like this for at least 4 or 5 years
is there a dedicated event ?
it used to be possible to detect it with an advancement
in 1.13+, you simply CANNOT detect it AT ALL
there is NO WAY
sad but true
that is the stupidest thing I have ever heard
how long are player uuids
and I'm currently watching a video of a guy who built robot legs for his snake
trying to figure out how to make it right now. Currently just can't figure out which of the obfuscated methods to use to get the compound tag of the nms itemstack
2 longs
32 chars, or 36 if you take account eh dashes
ok thx
why dont you use mojang mappings?
then you can just do sth like new TagList();
ListTag() *
is it possible to rotate a particle ? for example sweep attack
It was my understanding that using the mojmaps would mean that I would have to disable them whenever I want to build the plugin. Is that thecase?
erm no?
are you using maven?
gradle
oh yeah then you're a bit fucked
there is no proper remapping plugin for spigot + gradle
howeeeeeever
papermc uses gradle and you could use paperweight instead, which is basically paper's version of spigot's "remapping nms" thing
but I have no clue about it. all I can tell you is to either use maven, or take a look at paperweight
Yeah, this is the problem I ran into originally when I wanted to use mojmaps. Thanks for the paperweight tip, I'll take a look at that.
np!
(there's a third solution)
which is to simply compile your stuff with gradle, and then add a task that runs spigot's "specialsource" .jar manually. It's probably just one line to add to your gradle file but it's a bit of a dirty hack
and I also have no idea how this would look in gradle syntax. so yeah, I guess "paperweight" is the solution to go. Might wanna ping LynxPlay when he's online, I'm sure he can explain it to you in like 2 sentences
eclipse compiler worked, thanks alex
:3
I really havent understood what the issue is
but still, nice that my workaround worked lol
in your usecase were you using another api which used moj mappings?
no, it was back in 1.16
ah
mojang mappings didnt exist back then
and I only had this problem in one tiny inner class
PacketPlayerInfo...SomeInnerClass
still a mistery to me
I PR'd API for this about a year ago, maybe more. Didn't get approved because it broke in creative mode because fuck ItemMeta. It's so terrible
D:
Though I'm kind of glad it didn't because if we introduce ItemType and BlockType in the future, I'd rather have used those types instead of Keyed
What? Yeah. I don't have push access lol
I am 100% for another breaking change
replace Material with Block and Item
well, not BLock, but BLockType, like you mentioned
#660 has it. Just waiting on md's word for it to get merged lol
Will open up a lot of avenues for PRs
I'm still waiting for a reply from md_5 on tinder
pretty weird that we dont have it already
I can only imagine at this point he's waiting until 1.20
how can pp create new particle like this ? https://www.youtube.com/watch?v=B3RhIKwv2fk&t=69s
The Abyssion Pack is on sale only on mcmodels:
https://mcmodels.net/model/abyssion-skills-equipment/
Requires MythicMobs, ModelEngine, MythicLib, MMOcore, and MMOitems
Check out my other products: https://mcmodels.net/vendors/samus2002s-store/
Join our discord community: https://discord.gg/ggvbhjFZC3
===========================================...
the one on the ground or the slash effect?
YOU COULD HAVE AT LEAST GIVEN MY POST A LIKE D:
fine
splash one
squirt two?
probs just an armourstand with a custom item on the head
hmm u can control when that animation is play ?
i used to think about that but item animation is random
ah yeah its delayed isnt it
pretty sure itemstacks are your only option tho
unicode characters wouldnt be able to do that
and i dont think particle effects can either
particle effect can but u cant rotate the effect
Then probably just start with a static item
Then switch to the animated one after a delay
choco are you still here?
particles are sprites
they don't have any orientation
just wanted to mention this again 😛
i mean the item^
oh ok I thought you were talking about particles
the maven compiler doesnt work with lombok 😵
is there a way to get what item slot a player is currently on?
oh wait
heldItemSlot is always their selected slot
nvm got it, I was getting it from an inventory in an event needed to get it from the player
there's also InventoryClickEvent#getHotbarSlot() or similar
but that one is what they "swapped" or "shift-clicked" or whatever, and might be -1 if they didnt use the hotbar in the click event
so many fucking modules
damn whats that
yeah. ME
lol it's for a rpg server
How could you not see that silly
choco do you have any idea about this?
the post is for 1.16 but it's still valid for some classes even in 1.19 remapped
some classes are just "broken" using the normal compiler in maven
and since you always know everything, I thought maybe you know about this too
I just do a huge "core" library and let maven's "minimizeJar" thing handle about reducing unused stuff
First time I've seen that. Though if it's any consolation, we use the Eclipse compiler for Bukkit too
yeah thats what i first did but i'm trying to make it modular
is there a specific reason why bukkit uses the eclipse compiler?
Something about not actually requiring a JDK to be installed I think
hmmm
well I had this problem with this class mentioned in the post, and I didnt find a solution for AGES
why would they need that though
with AGES, I mean like 3 or 4 weeks
then I found some random SO post
and it worked
very weird, specific problem
Might have something to do with nullability annotations on that internal class and an instrumenter they compiled with
I'd try rebuilding in a fresh BuildTools directory or something and try again
you can track interactions in a player's own inventory right?
or is that also not possible?
Ah, tell you what Alex. I found a ForgeGradle bug from 2018 detailing this exact issue
It's a bug with the obfuscator Mojang is using, ProGuard, and Fernflower's decompiling of it
The Eclipse compiler may be a little more lenient on those annotation errors
oh yikes
wow that's so weird
how did you find this?
Google-fu
weird, maybe my googling skills were too bad back in the days
"cannot access ..." however is also a very shitty error message lol
anyway, it'S 6.30am. good night everyone :3
gn
Is there anyway for a plugin to change the message sent to console when the player is kicked via Player#kickPlayer(reason)
Hey,
I want to spawn a particle at a block location.
How do I do that?
declaration: package: org.bukkit, interface: World
theres heaps of overloads for it
thx
that doesn't exist.
i think that isn't gonna work
oh?
tysm
np
PlayerKickEvent#setKickReason
That works, however, it also changes the player's message. I want to just change what console is sent :/
then you will have to dig into the packets
or print info out to the console
I wonder how wynn does playerghosts so efficiently
cant imagine sending player data for 1k players each tick being super efficient
im guessing this is a bad idea
but
im using runnables for a timer
should i use while loop instead?
synchronized (imagine) {
while (imagine.get(plr.getUniqueId()) < 0) {
try {
imagine.wait(1000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
}```
that how
that pauses the main thread
exactly what the runTaskTimer is made for
new BukkitRunnable() {
@Override
public void run() {
imagine.put(plr.getUniqueId(), imagine.get(plr.getUniqueId()) - 1000L);
Other.broadcastMiniMessaage(Other.makeMiniMessage(Other.formatTimeMillis(imagine.get(plr.getUniqueId()))));
if (imagine.get(plr.getUniqueId()) < 0) {
imagine.remove(plr.getUniqueId());
this.cancel();
}
}
}.runTaskTimerAsynchronously(TestingPaperNMS.plugin, 20, 20);``` ik isn't the best code, first time doing timer
mostly for testing
works fine tho
i have a weird question: How does custom events works and how it gets called lol
the same as regular events
could do that
public class MyEvent extends Event{
}```
then call it
^
Needs a handlerlist iirc
yeah im just showing all you need to do is extend it
public class ServerBrodcastEvent extends Event implements Cancellable {
private String message;
private static final HandlerList HANDLERS_LIST = new HandlerList();
private boolean isCancelled;
public ServerBrodcastEvent(String message){
this.message = message;
this.isCancelled = false;
}
@Override
public boolean isCancelled() {
return isCancelled;
}
@Override
public void setCancelled(boolean cancelled) {
this.isCancelled = cancelled;
}
@Override
public HandlerList getHandlers() {
return HANDLERS_LIST;
}
public static HandlerList getHandlerList() {
return HANDLERS_LIST;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}```
kinda vague question, but is there a way to make a sheep entity appear as a zombie using packets?
if yes, what packet is it?
you can hide the sheep and spawn a zombie with packets
can't just change the entity though
yeah but the player only sees a sheep because the server tells the player there's a sheep there
can i lie to the player's face by telling them there's a zombie there?
not if you despawn it with packets
so i have to despawn the sheep with client side packets
and spawn a zombie using client side packets
yep
and send velocity packets for moving it?
bruh
not really
oh damn
if you do it efficiently
yeah nvm
may i ask what are you trying to do
im a dumbass
instead of replacing sheep with zombie
im trying to replace hostile entities with players
when i tried this before
same ai though?
it lagged the server after i created 6 of these
yep
i dont wanna do pathfinders and shit like sentinels and terminatorplus did
i just want a simple player with the brain of a zombie
for my npcs i spawn a human and use a hidden zo mbie for pathfinding
you could do something similar
mustve been doing it weird
under NDA sorry
ah
did you use a bukkitrunnable
or is that under the NDA aswell
idk how these legal docs work
alright
basically i keep track of every entity, which has an onTick method
the npcs have a child called NpcGhost or some shit
forgot what i called it
and i just tp the npc each tick to the zombie
in your case yeah, i have a custom entity manager so its a bit diff
alr
huh
which iterates through a collection of entities
one runnable, multiple entities
rather than one runnable per entity
so thats why your server didnt shit itself
yeah probs lol
good idea to limit your runnables
so far i haven't run into any performance issues
did a profiler for 1 hour with 200+ npcs and stayed at 20tps
and create a central runnable
yeah
yeah
and every time an entity is spawned
wait no
i put the entity instances inside a collection
yep exactly
yep
are you sure this wont shit a server
yeah, it wont
swear on mashed potatoes
just keep track of which entities are unloaded
and remove them
then add back on chunk load
alr
no
alr
Just make sure:
-registering/unregistering entities on chunk load/unload
-rehide the entity on chunk load
few things to keep track of, but it's robust
this is for a copy of hypixel dungeons
so i dont think i'll be unloading
if your enemies despawn then it kinda beats the purpose
whats more
please help #1014501962907140167
how do i set an EntityZombie's equipment?
1.8.8
:D
i love myself
i do not have suicidal tendencies
i tried using getbukkitentity
Can't remember code from 7 years ago
no one can
You'll have to decompile and look yourself
the intellij plugin development addon doesnt even support 1.8.8 💀
had to change it myself
Is there a way I can use .addItem on player's open inventory
